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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 348523005: Revert of cc: Early out sooner in UpdateTilePriorities when !CanHaveTilings(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/picture_layer_impl_unittest.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_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 29d285f31aca43bf124a7229f67e701907cbcfd9..600ace79e45b576226d93e841a2ac2d38031bc45 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -6574,5 +6574,61 @@
150u * 1024u * 1024u);
}
+TEST_F(LayerTreeHostImplTest, UpdateTilesForMasksWithNoVisibleContent) {
+ gfx::Size bounds(100000, 100);
+
+ host_impl_->CreatePendingTree();
+
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->pending_tree(), 1);
+
+ scoped_ptr<FakePictureLayerImpl> layer_with_mask =
+ FakePictureLayerImpl::Create(host_impl_->pending_tree(), 2);
+
+ layer_with_mask->SetBounds(bounds);
+ layer_with_mask->SetContentBounds(bounds);
+
+ scoped_ptr<FakePictureLayerImpl> mask =
+ FakePictureLayerImpl::Create(host_impl_->pending_tree(), 3);
+
+ mask->SetIsMask(true);
+ mask->SetBounds(bounds);
+ mask->SetContentBounds(bounds);
+
+ FakePictureLayerImpl* pending_mask_content = mask.get();
+ layer_with_mask->SetMaskLayer(mask.PassAs<LayerImpl>());
+
+ scoped_ptr<FakePictureLayerImpl> child_of_layer_with_mask =
+ FakePictureLayerImpl::Create(host_impl_->pending_tree(), 4);
+
+ child_of_layer_with_mask->SetBounds(bounds);
+ child_of_layer_with_mask->SetContentBounds(bounds);
+ child_of_layer_with_mask->SetDrawsContent(true);
+
+ layer_with_mask->AddChild(child_of_layer_with_mask.PassAs<LayerImpl>());
+
+ root->AddChild(layer_with_mask.PassAs<LayerImpl>());
+
+ host_impl_->pending_tree()->SetRootLayer(root.Pass());
+
+ gfx::Rect r1 = pending_mask_content->visible_rect_for_tile_priority();
+ ASSERT_EQ(0, r1.x());
+ ASSERT_EQ(0, r1.y());
+ ASSERT_EQ(0, r1.width());
+ ASSERT_EQ(0, r1.height());
+
+ host_impl_->ActivatePendingTree();
+
+ host_impl_->active_tree()->UpdateDrawProperties();
+
+ ASSERT_EQ(2u, host_impl_->active_tree()->RenderSurfaceLayerList().size());
+
+ FakePictureLayerImpl* active_mask_content =
+ static_cast<FakePictureLayerImpl*>(
+ host_impl_->active_tree()->root_layer()->children()[0]->mask_layer());
+ gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority();
+
+ ASSERT_TRUE(!r2.IsEmpty());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698