Commit b08e055f authored by shreyas.g@samsung.com's avatar shreyas.g@samsung.com

cc: check animation notify settings first in NotifyObservers

(like LayerAnimationController::NotifyObserversOpacityAnimated)

While sending the notification to the observers, the notify settings 
of the animation (active and pending) are checked against the state of
the observer (whether active or not). In most cases, the default 
setting of the animation will set active and pending as true. So in 
those cases there is no need to check for the active state of observer.

This patch first checks if both active and pending state are true for 
animation. If yes then it proceedes sending the notification to 
observer and there is no need to check the active state of observer.

Review URL: https://codereview.chromium.org/441913002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287554 0039d316-1c4b-4281-b951-d872f2087c98
parent b6bd6ee2
...@@ -927,7 +927,8 @@ void LayerAnimationController::NotifyObserversOpacityAnimated( ...@@ -927,7 +927,8 @@ void LayerAnimationController::NotifyObserversOpacityAnimated(
value_observers_); value_observers_);
LayerAnimationValueObserver* obs; LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) { 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())) (notify_pending_observers && !obs->IsActive()))
obs->OnOpacityAnimated(opacity); obs->OnOpacityAnimated(opacity);
} }
...@@ -943,7 +944,8 @@ void LayerAnimationController::NotifyObserversTransformAnimated( ...@@ -943,7 +944,8 @@ void LayerAnimationController::NotifyObserversTransformAnimated(
value_observers_); value_observers_);
LayerAnimationValueObserver* obs; LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) { 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())) (notify_pending_observers && !obs->IsActive()))
obs->OnTransformAnimated(transform); obs->OnTransformAnimated(transform);
} }
...@@ -959,7 +961,8 @@ void LayerAnimationController::NotifyObserversFilterAnimated( ...@@ -959,7 +961,8 @@ void LayerAnimationController::NotifyObserversFilterAnimated(
value_observers_); value_observers_);
LayerAnimationValueObserver* obs; LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) { 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())) (notify_pending_observers && !obs->IsActive()))
obs->OnFilterAnimated(filters); obs->OnFilterAnimated(filters);
} }
...@@ -975,7 +978,8 @@ void LayerAnimationController::NotifyObserversScrollOffsetAnimated( ...@@ -975,7 +978,8 @@ void LayerAnimationController::NotifyObserversScrollOffsetAnimated(
value_observers_); value_observers_);
LayerAnimationValueObserver* obs; LayerAnimationValueObserver* obs;
while ((obs = it.GetNext()) != NULL) { 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())) (notify_pending_observers && !obs->IsActive()))
obs->OnScrollOffsetAnimated(scroll_offset); obs->OnScrollOffsetAnimated(scroll_offset);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment