summaryrefslogtreecommitdiffstats
path: root/cc/animation/layer_animation_controller.cc
Commit message (Collapse)AuthorAgeFilesLines
* cc: Support animating scroll offsetajuma@chromium.org2013-12-031-0/+41
| | | | | | | | | | | This makes cc::LayerAnimationController support animating scroll offset. This is needed for implementing the CSSOM View smooth scroll API. BUG=243871 Review URL: https://codereview.chromium.org/95763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238271 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused cc::Animation RunStatesajuma@chromium.org2013-11-211-52/+3
| | | | | | | | | | | | This removes cc::Animation::WaitingForNextTick and cc::Animation::WaitingForStartTime. These run states are not currently used. BUG=None Review URL: https://codereview.chromium.org/77283004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236427 0039d316-1c4b-4281-b951-d872f2087c98
* Don't PushProperties every commit for animating layersajuma@chromium.org2013-11-181-37/+24
| | | | | | | | | | | | | | | | This removes the need to PushProperties every commit during an animation. Instead, a single PushProperties is needed whenever there are animations waiting for deletion. This also removes LayerAnimationController::set_force_sync, which no longer had any non-test callers and wasn't actually needed by its test callers. BUG=259088 Review URL: https://codereview.chromium.org/60083018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235845 0039d316-1c4b-4281-b951-d872f2087c98
* De-activate LayerAnimationControllers when all animations are WaitingForDeletionajuma@chromium.org2013-11-181-3/+11
| | | | | | | | | | | | Animations that are in the WaitingForDeletion state cannot make any further progress, so we do not need to tick LayerAnimationControllers that only have such animations. BUG=319557 Review URL: https://codereview.chromium.org/73343002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235657 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Alow animations to be aborted from either threadajuma@chromium.org2013-11-171-4/+40
| | | | | | | | | | | | | | | | | This makes LayerAnimationController correctly handle animations that are aborted on the compositor thread. It also adds an AbortAnimations method that aborts all animations with a particular target property. These changes are needed for implementing the CSSOM View smooth scroll API, since we will require the ability to abort scroll animations on the compositor thread as a result of input events received by the compositor thread. BUG=243871 Review URL: https://codereview.chromium.org/68503014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235557 0039d316-1c4b-4281-b951-d872f2087c98
* Remove cc::LayerAnimationController:SuspendAnimationsajuma@chromium.org2013-11-021-8/+0
| | | | | | | | | | | | This removes LayerAnimationController::SuspendAnimations, which is no longer used now that layout tests use LayerAnimationController::PauseAnimation. BUG=312060 Review URL: https://codereview.chromium.org/50903002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232545 0039d316-1c4b-4281-b951-d872f2087c98
* Add Color animation curves.avallee@chromium.org2013-10-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Implement animation curves for colors. This is the first step towards accelerating background-color animations. + Add ColorValueBetween to gfx::Tween. + Add test/color_utils which gives EXPECT_COLOR_EQ to check SkColors and print in a sane format. ~ Fixed discrepancy between two methods of interpolating ints. ~ Factored out GetProgress into template function to simplify code in the implementations of GetValue(double), there was a lot of duplication there. TESTED: Added tests for the new KeyframedColorAnimations and AnimatedColor classes. Added tests to tweening. R=ajuma BUG=290234 Review URL: https://codereview.chromium.org/25901002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230856 0039d316-1c4b-4281-b951-d872f2087c98
* Remove superfluous WebLayerImpl::resumeAnimations()steveblock@chromium.org2013-10-231-10/+1
| | | | | | | | | | | | This is no longer required, as WebLayer::resumeAnimations() was removed in https://codereview.chromium.org/27589003, BUG=248938, 243353, 62138, 61739 R=dstockwell Review URL: https://codereview.chromium.org/31473002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230407 0039d316-1c4b-4281-b951-d872f2087c98
* Remove Animation::InstanceType.dongseong.hwang@intel.com2013-10-181-4/+2
| | | | | | | | | | | A cloned Animation instance is always controlling instance, so Animation::InstanceType enum is useless. BUG=290217 Review URL: https://codereview.chromium.org/26205006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229287 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Support animating filtersajuma@chromium.org2013-10-031-22/+61
| | | | | | | | | | | | This adds a new Animation::TargetProperty for filters, and updates LayerAnimationController to support this new target. BUG=181613 Review URL: https://codereview.chromium.org/25311003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226766 0039d316-1c4b-4281-b951-d872f2087c98
* Take time_offset into account when ticking animations that are Startingajuma@chromium.org2013-09-041-10/+0
| | | | | | | | | | | | | | LayerAnimationController::TickAnimations ignores the time_offset for animations that are Starting and for animations waiting for a synchronized start time. This CL makes Animation::TrimTimeToCurrentIteration handle computing the trimmed time for such animations, removing the need for TickAnimations to have special cases for computing trimmed time. BUG=284590 Review URL: https://chromiumcodereview.appspot.com/23926003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221257 0039d316-1c4b-4281-b951-d872f2087c98
* Compute bounds of animated layersajuma@chromium.org2013-08-151-0/+26
| | | | | | | | | | | | | This adds support for computing the bounds of a box when transformed by the animations currently running on layer. This CL handles Scale and Translate animations, leaving other TransformOperations for future CLs. BUG=252472 Review URL: https://chromiumcodereview.appspot.com/21604002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217845 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Create a AnimationDelegate interface and an adapter class in ↵tfarina@chromium.org2013-06-261-5/+5
| | | | | | | | | | | | | | | | | compositor_bindings. Instead of having cc/ talk directly to the WebKit::WebAnimationDelegate, we create an abstract interface in cc/ that it can talk to. In the compositor_bindings, we implement this class, and forward the function calls made into it over to the WebKit implementation. BUG=None TEST=cc_unittests, webkit_compositor_bindings_unittests R=jamesr@chromium.org Review URL: https://codereview.chromium.org/17755003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208800 0039d316-1c4b-4281-b951-d872f2087c98
* cc: remove TransferAnimationsTo dead codeshawnsingh@chromium.org2013-06-051-11/+0
| | | | | | | | | | | | After removing m_transformLayer from Blink's GraphicsLayer class, TransferAnimationsTo is now dead code that can be removed. The WebLayer API declaration is in Blink and will be removed in a follow-up patch. BUG=245520 Review URL: https://chromiumcodereview.appspot.com/15896030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204090 0039d316-1c4b-4281-b951-d872f2087c98
* Update refernces to Blink's Platform API (cc)abarth@chromium.org2013-05-291-1/+1
| | | | | | | | | | | | | | These headers have moved from Source/Platform/chromium/public to public/platform. This CL updates CC's references to the old location to point to the new location. After this CL lands, I'll remove the forwarding headers that are letting these references still work. TBR=jamesr@chromium.org BUG=239545 Review URL: https://chromiumcodereview.appspot.com/16085003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202990 0039d316-1c4b-4281-b951-d872f2087c98
* Allow animations with inactive observers to reach the Starting stateajuma@chromium.org2013-05-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, when a LayerAnimationController only has an observer in the pending tree, we early-out from Animate and UpdateState in order to prevent animating a layer before it's drawn. However, this means that the position of a layer can change immediately after tree activation (even before a draw), if an animation is started on that layer. This means that tile priorities calculated by UpdateTilePriorites before tree activation can immediately become stale. This CL allows animations with only inactive observers to reach the Starting state and get ticked at their starting point, but progress no further. This means we still won't have running animations on layers before they're drawn. However, this change means that if we ensure that animation always happens before tree activation in each frame (in a follow-up CL), then the tile priorities calculated during tree activation will still be valid when the frame is drawn. BUG=242966 Review URL: https://chromiumcodereview.appspot.com/15732013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202473 0039d316-1c4b-4281-b951-d872f2087c98
* Fix main-thread event handling for impl-only animationsajuma@chromium.org2013-04-111-5/+25
| | | | | | | | | | | | | | | | Since impl-only animations have no main-thread counterpart, the main thread (more specifically, LayerTreeHost::SetAnimationEvents, LayerAnimationController::NotifyAnimationStarted, and LayerAnimationController::NotifyAnimationFinished) should not assume that incoming events will be for animations that are running on the main thread. BUG=196284 Review URL: https://chromiumcodereview.appspot.com/14137009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193700 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 193629 "Fix main-thread event handling for impl-only anim..."kinuko@chromium.org2013-04-111-25/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Broke multiple tests on Windows LayerTreeHostAnimationTestAddAnimation.RunMultiThread LayerTreeHostAnimationTestAddAnimation.RunSingleThread http://build.chromium.org/p/chromium.win/buildstatus?builder=Win7%20Tests%20%28dbg%29%281%29&number=17504 > Fix main-thread event handling for impl-only animations > > Since impl-only animations have no main-thread counterpart, the > main thread (more specifically, LayerTreeHost::SetAnimationEvents, > LayerAnimationController::NotifyAnimationStarted, and > LayerAnimationController::NotfiyAnimationFinished) should not > assume that incoming events will be for animations that are > running on the main thread. > > BUG=196284 > > Review URL: https://chromiumcodereview.appspot.com/13820019 TBR=ajuma@chromium.org Review URL: https://codereview.chromium.org/13880010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193635 0039d316-1c4b-4281-b951-d872f2087c98
* Fix main-thread event handling for impl-only animationsajuma@chromium.org2013-04-111-5/+25
| | | | | | | | | | | | | | | Since impl-only animations have no main-thread counterpart, the main thread (more specifically, LayerTreeHost::SetAnimationEvents, LayerAnimationController::NotifyAnimationStarted, and LayerAnimationController::NotfiyAnimationFinished) should not assume that incoming events will be for animations that are running on the main thread. BUG=196284 Review URL: https://chromiumcodereview.appspot.com/13820019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193629 0039d316-1c4b-4281-b951-d872f2087c98
* LayerTreeHost::SetAnimationEvents should use AnimationRegistrarajuma@chromium.org2013-04-081-39/+118
| | | | | | | | | | | | | | | This makes LayerTreeHost::SetAnimationEvents iterate over all active animation controllers registered with its AnimationRegistrar instead of iterating over the layer tree. This allows us to properly deliver animation events to a layer that has been temporarily removed from the layer tree when SetAnimationEvents is called. BUG=196284 Review URL: https://chromiumcodereview.appspot.com/13465014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192835 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Make animations tick regardless of drawing.danakj@chromium.org2013-04-061-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compositor should tick and finish animations even if it is not drawing anything. It can not draw for various reasons: 1) The tab is backgrounded. 2) CanDraw() is false for any of its reasons. 3) PrepareToDraw() fails due to checkerboarding. 4) There is no damage on the screen to draw. Currently the problems are: - When backgrounded, the animations are ticked but their states are not updated. - When CanDraw() is false, we don't draw, and animations just stop ticking. - If we stop drawing when we damage the screen, we tick animations, but don't update animation state since this happens in DrawLayers(). To solve these problems, I've moved the animation control more explicitly out of LayerTreeHostImpl. The proxy already calls Animate(). Now it will also call UpdateAnimationState(). It always does this after calling Animate() regardless if drawing or not. Secondly, the missing UpdateAnimationState() call is added to the OnTimerTick for background animation ticking. We enable background ticking only when we change visibility, currently. But when CanDraw() is false, we don't draw and thus don't tick animations. So instead we add to LayerTreeHostImpl a UpdateBackgroundAnimateTicking() method. We call this always after calling Animate() since that can remove animations - it's something Animate() used to do. And we also call this: a) After a commit - this could add new animations, or change visibility. b) After changing CanDraw()'s state. However, when PrepareToDraw() is false, we do not want to start new animations so we let animations finish without starting new ones. This is verified by the LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations test. This is covered by adding single-thread mode to all the animation unit tests (except those that call SetNeedsAnimate() which is not legal in single thread mode). Also by new tests: LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw.RunSingleThread LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw.RunMultiThread LayerTreeHostAnimationTestRunAnimationWhenNotVisible.RunSingleThread LayerTreeHostAnimationTestRunAnimationWhenNotVisible.RunMultiThread LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations.RunMultiThread Added scheduler tests: SchedulerStateMachineTest.ReportIfNotDrawing SchedulerStateMachineTest.ReportIfNotDrawingFromAcquiredTextures R=ajuma@chromium.org BUG=222915 Review URL: https://chromiumcodereview.appspot.com/13613003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192671 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Convert non-const reference arguments to pointers.danakj@chromium.org2013-03-271-4/+4
| | | | | | | | | | | Style-only change. This is forbidden by the style guide. R=jamesr Review URL: https://chromiumcodereview.appspot.com/12912010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190851 0039d316-1c4b-4281-b951-d872f2087c98
* Fix cpplint errors in cc/(animation|input|layers|trees|test)/jamesr@chromium.org2013-03-261-5/+3
| | | | | | | | | | | This fixes lint errors in everything except for the few stragglers (occlusion unit test, etc) that haven't been chromified. BUG=144577 Review URL: https://chromiumcodereview.appspot.com/12965007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190767 0039d316-1c4b-4281-b951-d872f2087c98
* cc: Fix capitalization style in chromified files.danakj@chromium.org2013-03-251-1/+1
| | | | | | | | | | | | | | | | | Style-only change. Many already-chromified files missed a variable or function name here and there. This grabs (hopefully) all of them. For the record, I found these with: git gs '[^a-zA-Z0-9_>\."][a-jl-z]\+[A-Z][A-Za-z0-9_]*\($\|[ !=;,\.^&*)"]\)' R=enne BUG= Review URL: https://chromiumcodereview.appspot.com/12676029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190326 0039d316-1c4b-4281-b951-d872f2087c98
* Part 3 of cc/ directory shuffles: animationjamesr@chromium.org2013-03-181-0/+628
Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681 BUG=190824 TBR=enne@chromium.org, vollick@chromium.org Review URL: https://codereview.chromium.org/12822004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188688 0039d316-1c4b-4281-b951-d872f2087c98