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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1855013002: cc : Stop calculating visible rects on main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/trees/layer_tree_host_common.cc ('k') | cc/trees/property_tree_builder.h » ('j') | 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 36e8d599fb0f6648ae572a6c8d6e7312e606dd69..14e7f996b6f9d4b5d715fa66a2e5de040b18dbb8 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -780,12 +780,17 @@ class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
SINGLE_THREAD_TEST_F(LayerTreeHostTestPropertyTreesChangedSync);
+// Test that when mask layers switches layers, this gets pushed onto impl.
+// Also test that mask layer is in the layer update list even if its owning
+// layer isn't.
class LayerTreeHostTestSwitchMaskLayer : public LayerTreeHostTest {
protected:
void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
+ root->SetBounds(gfx::Size(10, 10));
scoped_refptr<Layer> child = Layer::Create();
mask_layer = Layer::Create();
+ mask_layer->SetBounds(gfx::Size(10, 10));
child->SetMaskLayer(mask_layer.get());
root->AddChild(std::move(child));
layer_tree_host()->SetRootLayer(root);
@@ -800,6 +805,20 @@ class LayerTreeHostTestSwitchMaskLayer : public LayerTreeHostTest {
void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
+ // Root and mask layer should have the same source frame number as they
+ // will be in the layer update list but the child is not as it has empty
+ // bounds.
+ EXPECT_EQ(mask_layer->paint_properties().source_frame_number,
+ layer_tree_host()
+ ->root_layer()
+ ->paint_properties()
+ .source_frame_number);
+ EXPECT_NE(mask_layer->paint_properties().source_frame_number,
+ layer_tree_host()
+ ->root_layer()
+ ->child_at(0)
+ ->paint_properties()
+ .source_frame_number);
layer_tree_host()->root_layer()->RemoveAllChildren();
layer_tree_host()->root_layer()->SetMaskLayer(mask_layer.get());
break;
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/property_tree_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698