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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1834883002: cc : Fix layer transform changed tracking bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 5086f7fbbfc8be6f2cf3501ddcfeb5f18e73afb9..39d25f277b75fac96f605e5cd851ec9d865049f5 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -692,6 +692,10 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
protected:
void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ // This is to force the child to create a transform and effect node.
+ child->SetForceRenderSurface(true);
+ root->AddChild(std::move(child));
layer_tree_host()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -725,16 +729,31 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
impl->active_tree()->ResetAllChangeTracking(
PropertyTrees::ResetFlags::EFFECT_TREE);
EXPECT_FALSE(impl->active_tree()->root_layer()->LayerPropertyChanged());
+ EXPECT_FALSE(impl->active_tree()
+ ->root_layer()
+ ->child_at(0)
+ ->LayerPropertyChanged());
transform.Translate(10, 10);
impl->active_tree()->root_layer()->OnTransformAnimated(transform);
+ // We rebuild property trees on main thread to test the code path of
+ // damage status synchronization when property trees are different.
+ layer_tree_host()->property_trees()->needs_rebuild = true;
ajuma 2016/03/24 23:55:53 This is accessing the LayerTreeHost from the compo
jaydasika 2016/03/25 00:05:25 Done.
PostSetNeedsCommitToMainThread();
break;
case FILTER:
index_++;
EXPECT_TRUE(impl->active_tree()->root_layer()->LayerPropertyChanged());
+ EXPECT_TRUE(impl->active_tree()
+ ->root_layer()
+ ->child_at(0)
+ ->LayerPropertyChanged());
impl->active_tree()->ResetAllChangeTracking(
PropertyTrees::ResetFlags::TRANSFORM_TREE);
EXPECT_FALSE(impl->active_tree()->root_layer()->LayerPropertyChanged());
+ EXPECT_FALSE(impl->active_tree()
+ ->root_layer()
+ ->child_at(0)
+ ->LayerPropertyChanged());
filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
impl->active_tree()->root_layer()->OnFilterAnimated(filters);
PostSetNeedsCommitToMainThread();
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698