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

Unified Diff: cc/animation/layer_animation_controller.cc

Issue 441913002: Check animation notify values first while sending notification to Observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_animation_controller.cc
diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc
index 0088c3dde8ed422451abc14a11f5059fa7df5a55..84e6ce801f007187a3aad837361ca8cba3485077 100644
--- a/cc/animation/layer_animation_controller.cc
+++ b/cc/animation/layer_animation_controller.cc
@@ -365,16 +365,12 @@ void LayerAnimationController::NotifyAnimationAborted(
void LayerAnimationController::NotifyAnimationPropertyUpdate(
const AnimationEvent& event) {
- bool notify_active_observers = true;
- bool notify_pending_observers = true;
ajuma 2014/08/05 13:05:57 These variables act as a form of documentation all
shreyas.g 2014/08/05 13:41:52 Done. Makes sense. Will keep that in mind for futu
switch (event.target_property) {
case Animation::Opacity:
- NotifyObserversOpacityAnimated(
- event.opacity, notify_active_observers, notify_pending_observers);
+ NotifyObserversOpacityAnimated(event.opacity, true, true);
break;
case Animation::Transform:
- NotifyObserversTransformAnimated(
- event.transform, notify_active_observers, notify_pending_observers);
+ NotifyObserversTransformAnimated(event.transform, true, true);
break;
default:
NOTREACHED();
@@ -924,7 +920,8 @@ void LayerAnimationController::NotifyObserversOpacityAnimated(
value_observers_);
LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) {
- if ((notify_active_observers && obs->IsActive()) ||
+ if ((notify_active_observers && notify_pending_observers) ||
+ (notify_active_observers && obs->IsActive()) ||
(notify_pending_observers && !obs->IsActive()))
obs->OnOpacityAnimated(opacity);
}
@@ -940,7 +937,8 @@ void LayerAnimationController::NotifyObserversTransformAnimated(
value_observers_);
LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) {
- if ((notify_active_observers && obs->IsActive()) ||
+ if ((notify_active_observers && notify_pending_observers) ||
+ (notify_active_observers && obs->IsActive()) ||
(notify_pending_observers && !obs->IsActive()))
obs->OnTransformAnimated(transform);
}
@@ -956,7 +954,8 @@ void LayerAnimationController::NotifyObserversFilterAnimated(
value_observers_);
LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) {
- if ((notify_active_observers && obs->IsActive()) ||
+ if ((notify_active_observers && notify_pending_observers) ||
+ (notify_active_observers && obs->IsActive()) ||
(notify_pending_observers && !obs->IsActive()))
obs->OnFilterAnimated(filters);
}
@@ -972,7 +971,8 @@ void LayerAnimationController::NotifyObserversScrollOffsetAnimated(
value_observers_);
LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) {
- if ((notify_active_observers && obs->IsActive()) ||
+ if ((notify_active_observers && notify_pending_observers) ||
+ (notify_active_observers && obs->IsActive()) ||
(notify_pending_observers && !obs->IsActive()))
obs->OnScrollOffsetAnimated(scroll_offset);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698