summaryrefslogtreecommitdiffstats
path: root/cc/layers/layer_impl.cc
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2015-05-25 13:18:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-25 20:19:20 +0000
commit59c23b4553b683f8fca3707f50be185cafcee052 (patch)
treec642ef98f44ad10e283f6672e6e379bbe753a61f /cc/layers/layer_impl.cc
parent241d77b78ce08e6068eb6f985e89d72da5423669 (diff)
downloadchromium_src-59c23b4553b683f8fca3707f50be185cafcee052.zip
chromium_src-59c23b4553b683f8fca3707f50be185cafcee052.tar.gz
chromium_src-59c23b4553b683f8fca3707f50be185cafcee052.tar.bz2
cc: Update property trees when there are compositor animations
This updates property trees for changes caused by compositor-driven transform and opacity animations. This fixes 20 tests that fail when verification is turned on. BUG=481585 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1152033002 Cr-Commit-Position: refs/heads/master@{#331301}
Diffstat (limited to 'cc/layers/layer_impl.cc')
-rw-r--r--cc/layers/layer_impl.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 46a4c95..5541a00 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -806,6 +806,34 @@ void LayerImpl::ResetAllChangeTrackingForSubtree() {
num_dependents_need_push_properties_ = 0;
}
+void LayerImpl::UpdatePropertyTreeTransform() {
+ if (transform_tree_index_ != -1) {
+ TransformTree& transform_tree =
+ layer_tree_impl()->property_trees()->transform_tree;
+ TransformNode* node = transform_tree.Node(transform_tree_index_);
+ if (node->data.local != transform_) {
+ node->data.local = transform_;
+ node->data.needs_local_transform_update = true;
+ transform_tree.set_needs_update(true);
+ // TODO(ajuma): The current criteria for creating clip nodes means that
+ // property trees may need to be rebuilt when the new transform isn't
+ // axis-aligned wrt the old transform (see Layer::SetTransform). Since
+ // rebuilding property trees every frame of a transform animation is
+ // something we should try to avoid, change property tree-building so that
+ // it doesn't depend on axis aliginment.
+ }
+ }
+}
+
+void LayerImpl::UpdatePropertyTreeOpacity() {
+ if (opacity_tree_index_ != -1) {
+ OpacityTree& opacity_tree =
+ layer_tree_impl()->property_trees()->opacity_tree;
+ OpacityNode* node = opacity_tree.Node(opacity_tree_index_);
+ node->data = opacity_;
+ }
+}
+
gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const {
return CurrentScrollOffset();
}
@@ -816,10 +844,12 @@ void LayerImpl::OnFilterAnimated(const FilterOperations& filters) {
void LayerImpl::OnOpacityAnimated(float opacity) {
SetOpacity(opacity);
+ UpdatePropertyTreeOpacity();
}
void LayerImpl::OnTransformAnimated(const gfx::Transform& transform) {
SetTransform(transform);
+ UpdatePropertyTreeTransform();
}
void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) {