From f5cd9e5d3c402226c8ff260eb63562df269f27ac Mon Sep 17 00:00:00 2001 From: "vollick@chromium.org" Date: Thu, 3 Nov 2011 21:38:08 +0000 Subject: Setting a layer property immediately should cancel any current animations. This CL depends on http://codereview.chromium.org/8395046/ The fix boils down to two changes to the layer animator: 1. When calling Set*** we must start a zero duration animation and not short circuit. The animator needs to be able to update its state, and the preemption strategy needs to be applied. 2. Always be aware that progressing or aborting animation may affect the list of running animation and take appropriate precautions. I have added a unit test to make sure the fix for 102413 doesn't regress and updated the existing unit tests for the new behavior (specifically, we now get notified that a sequence has ended whenever we call Set*** because of 1. above). BUG=102413 TEST=compositor_unittests Review URL: http://codereview.chromium.org/8387051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108546 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/base/animation/tween.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/base/animation') diff --git a/ui/base/animation/tween.cc b/ui/base/animation/tween.cc index a16bb18..3d57aef 100644 --- a/ui/base/animation/tween.cc +++ b/ui/base/animation/tween.cc @@ -91,6 +91,11 @@ gfx::Rect Tween::ValueBetween(double value, Transform Tween::ValueBetween(double value, const Transform& start_transform, const Transform& end_transform) { + if (value >= 1.0) + return end_transform; + if (value <= 0.0) + return start_transform; + Transform to_return; gfx::Point start_translation, end_translation; float start_rotation, end_rotation; -- cgit v1.1