summaryrefslogtreecommitdiffstats
path: root/cc/animation/animation_host.cc
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2015-07-13 11:37:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-13 18:38:17 +0000
commite7425277e33dd626227dc7aaf93ee6ddbed48f68 (patch)
treeb775b75f683cba6e0b42cf311d2d09e7c234c5a1 /cc/animation/animation_host.cc
parent6824eb61d14a8306d93498897dec46deaf7e390b (diff)
downloadchromium_src-e7425277e33dd626227dc7aaf93ee6ddbed48f68.zip
chromium_src-e7425277e33dd626227dc7aaf93ee6ddbed48f68.tar.gz
chromium_src-e7425277e33dd626227dc7aaf93ee6ddbed48f68.tar.bz2
cc: Fix post-commit property tree update for animations
After a commit, property tree nodes corresponding to animated layers have their values updated during a layer tree walk, to handle the case where the most recent compositor thread animation tick happened at a different time than the most recent main thread tick. This CL fixes two problems with this update: 1) An animation that's running at the start of a BeginMainFrame may finish on the compositor thread before the commit. In this situation, the property tree still needs to updated after commit. The current logic used by LayerImpl to decide whether an update is needed involves calling TransformIsAnimating or OpacityIsAnimating, but these will be false since the animation has finished. As a result, the update doesn't happen and the property tree is out-of-sync. 2) If an in-progress animation is removed on the main thread, the previously-animated layer may no longer own a property tree node. However, right after commit, the animation is still in a "Running" state on the compositor thread (so that the active tree continues to be affected until tree activation). As a result, LayerImpl will update a tree node that it doesn't actually own, so this node will end up with the wrong value. To fix these problems, LayerImpl now checks for any animation rather than only those that aren't finished (to handle the possibility that the animation might have finished during the commit), and also now checks that it owns a property tree node before updating this node (to handle the possibility that it no longer owns a node). All layout tests now pass with property tree verification enabled. BUG=509679 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1231903005 Cr-Commit-Position: refs/heads/master@{#338537}
Diffstat (limited to 'cc/animation/animation_host.cc')
-rw-r--r--cc/animation/animation_host.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index e7f289f..8bab8ab 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -394,6 +394,16 @@ bool AnimationHost::HasPotentiallyRunningTransformAnimation(
return animation && !animation->is_finished();
}
+bool AnimationHost::HasAnyAnimationTargetingProperty(
+ int layer_id,
+ Animation::TargetProperty property) const {
+ LayerAnimationController* controller = GetControllerForLayerId(layer_id);
+ if (!controller)
+ return false;
+
+ return !!controller->GetAnimation(property);
+}
+
bool AnimationHost::FilterIsAnimatingOnImplOnly(int layer_id) const {
LayerAnimationController* controller = GetControllerForLayerId(layer_id);
if (!controller)