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

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..16b9eadb145558cbd05bb1623dea24d7cf39a878 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();
}
@@ -708,6 +712,18 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
PostSetNeedsCommitToMainThread();
}
+ void DidCommit() override {
+ switch (layer_tree_host()->source_frame_number()) {
+ case 2:
+ // We rebuild property trees for this case to test the code path of
+ // damage status synchronization when property trees are different.
+ layer_tree_host()->property_trees()->needs_rebuild = true;
+ break;
+ default:
+ EXPECT_FALSE(layer_tree_host()->property_trees()->needs_rebuild);
+ }
+ }
+
void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
gfx::Transform transform;
FilterOperations filters;
@@ -725,6 +741,10 @@ 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);
PostSetNeedsCommitToMainThread();
@@ -732,9 +752,17 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
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