summaryrefslogtreecommitdiffstats
path: root/cc/layers/picture_layer_impl_unittest.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 17:52:20 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 17:52:20 +0000
commit2b3d84d6e8caddf8a285a99101300b13572189df (patch)
treec64b64d5ba73240e1522b2e10be1638020574043 /cc/layers/picture_layer_impl_unittest.cc
parentbf6cb40256a5692d3c72163633aa6701eaeb8baa (diff)
downloadchromium_src-2b3d84d6e8caddf8a285a99101300b13572189df.zip
chromium_src-2b3d84d6e8caddf8a285a99101300b13572189df.tar.gz
chromium_src-2b3d84d6e8caddf8a285a99101300b13572189df.tar.bz2
cc: Early out sooner in UpdateTilePriorities when !CanHaveTilings().
Also, when we cleanup tilings on the active twin, we use the pending twin's ideal contents scale. But when the twin !CanHavTilings() there is no need to use that ideal scale and save tilings. R=enne@chromium.org, enne Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278219 Review URL: https://codereview.chromium.org/334953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/picture_layer_impl_unittest.cc')
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index c26f74b..38e20e2 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -2774,5 +2774,50 @@ TEST_F(PictureLayerImplTest, SharedQuadStateContainsMaxTilingScale) {
quad_culler.shared_quad_state_list()[0]->visible_content_rect.ToString());
}
+TEST_F(PictureLayerImplTest, UpdateTilesForMasksWithNoVisibleContent) {
+ gfx::Size tile_size(400, 400);
+ 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_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, bounds);
+ scoped_ptr<FakePictureLayerImpl> mask = FakePictureLayerImpl::CreateWithPile(
+ host_impl_.pending_tree(), 3, pending_pile);
+
+ mask->SetIsMask(true);
+ mask->SetBounds(bounds);
+ mask->SetContentBounds(bounds);
+ mask->SetDrawsContent(true);
+
+ 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());
+
+ EXPECT_FALSE(pending_mask_content->tilings());
+ host_impl_.pending_tree()->UpdateDrawProperties();
+ EXPECT_NE(0u, pending_mask_content->num_tilings());
+}
+
} // namespace
} // namespace cc