summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 04:05:14 +0000
committerjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-19 04:05:14 +0000
commit3a4caa1dbea2d7a1d1e16489ef4e57145d42c59c (patch)
tree702f4f39ffaadd7fb065cf52edbd85b62482821b /cc/trees
parenta1e624f340df94d478ebc4f087d11b79e8b17378 (diff)
downloadchromium_src-3a4caa1dbea2d7a1d1e16489ef4e57145d42c59c.zip
chromium_src-3a4caa1dbea2d7a1d1e16489ef4e57145d42c59c.tar.gz
chromium_src-3a4caa1dbea2d7a1d1e16489ef4e57145d42c59c.tar.bz2
Revert of cc: Early out sooner in UpdateTilePriorities when !CanHaveTilings(). (https://codereview.chromium.org/334953003/)
Reason for revert: This appears to have broken: CreateTilingsEvenIfTwinHasNone ManageTilingsWithNoRecording http://build.chromium.org/p/chromium.mac/waterfall?builder=Mac%2010.7%20Tests%20(dbg)(1) http://build.chromium.org/p/chromium.win/waterfall?builder=Win7%20Tests%20(dbg)(1) http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29%2832%29/builds/13876 Original issue's description: > 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 TBR=enne@chromium.org,danakj@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/348523005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc56
1 files changed, 56 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 29d285f..600ace7 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -6574,5 +6574,61 @@ TEST_F(LayerTreeHostImplWithImplicitLimitsTest, ImplicitMemoryLimits) {
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