Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Side by Side Diff: cc/layer_animation_controller.cc

Issue 11633044: We don't want to tick animation controllers for non-active layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding the suggested TODO. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_animation_controller.h ('k') | cc/layer_animation_value_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layer_animation_controller.h" 5 #include "cc/layer_animation_controller.h"
6 6
7 #include "cc/active_animation.h" 7 #include "cc/active_animation.h"
8 #include "cc/animation_registrar.h" 8 #include "cc/animation_registrar.h"
9 #include "cc/keyframed_animation_curve.h" 9 #include "cc/keyframed_animation_curve.h"
10 #include "cc/layer_animation_value_observer.h" 10 #include "cc/layer_animation_value_observer.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 removeAnimationsCompletedOnMainThread(controllerImpl); 96 removeAnimationsCompletedOnMainThread(controllerImpl);
97 97
98 pushPropertiesToImplThread(controllerImpl); 98 pushPropertiesToImplThread(controllerImpl);
99 } 99 }
100 controllerImpl->updateActivation(); 100 controllerImpl->updateActivation();
101 updateActivation(); 101 updateActivation();
102 } 102 }
103 103
104 void LayerAnimationController::animate(double monotonicTime, AnimationEventsVect or* events) 104 void LayerAnimationController::animate(double monotonicTime, AnimationEventsVect or* events)
105 { 105 {
106 if (!hasActiveObserver())
107 return;
108
106 startAnimationsWaitingForNextTick(monotonicTime, events); 109 startAnimationsWaitingForNextTick(monotonicTime, events);
107 startAnimationsWaitingForStartTime(monotonicTime, events); 110 startAnimationsWaitingForStartTime(monotonicTime, events);
108 startAnimationsWaitingForTargetAvailability(monotonicTime, events); 111 startAnimationsWaitingForTargetAvailability(monotonicTime, events);
109 resolveConflicts(monotonicTime); 112 resolveConflicts(monotonicTime);
110 tickAnimations(monotonicTime); 113 tickAnimations(monotonicTime);
111 markAnimationsForDeletion(monotonicTime, events); 114 markAnimationsForDeletion(monotonicTime, events);
112 startAnimationsWaitingForTargetAvailability(monotonicTime, events); 115 startAnimationsWaitingForTargetAvailability(monotonicTime, events);
113 116
114 updateActivation(); 117 updateActivation();
115 } 118 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 OnOpacityAnimated(opacity)); 453 OnOpacityAnimated(opacity));
451 } 454 }
452 455
453 void LayerAnimationController::notifyObserversTransformAnimated(const gfx::Trans form& transform) 456 void LayerAnimationController::notifyObserversTransformAnimated(const gfx::Trans form& transform)
454 { 457 {
455 FOR_EACH_OBSERVER(LayerAnimationValueObserver, 458 FOR_EACH_OBSERVER(LayerAnimationValueObserver,
456 m_observers, 459 m_observers,
457 OnTransformAnimated(transform)); 460 OnTransformAnimated(transform));
458 } 461 }
459 462
463 bool LayerAnimationController::hasActiveObserver()
464 {
465 if (m_observers.might_have_observers()) {
466 ObserverListBase<LayerAnimationValueObserver>::Iterator it(m_observers);
467 LayerAnimationValueObserver* obs;
468 while ((obs = it.GetNext()) != NULL)
469 if (obs->IsActive())
470 return true;
471 }
472 return false;
473 }
474
460 } // namespace cc 475 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_animation_controller.h ('k') | cc/layer_animation_value_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698