diff options
author | boliu <boliu@chromium.org> | 2016-01-26 14:18:01 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-26 22:19:27 +0000 |
commit | 99b904adcfc2d25f5a06bcf1e122387ef2c21d7d (patch) | |
tree | 2d8e528fe5c7fc88617a157a5921f2cd44ea6cf1 /cc/trees/layer_tree_host_impl_unittest.cc | |
parent | 2d80f2acbe03609234bdac2cd569d14d31c2aa7c (diff) | |
download | chromium_src-99b904adcfc2d25f5a06bcf1e122387ef2c21d7d.zip chromium_src-99b904adcfc2d25f5a06bcf1e122387ef2c21d7d.tar.gz chromium_src-99b904adcfc2d25f5a06bcf1e122387ef2c21d7d.tar.bz2 |
cc: Early out of UpdateTiles for resoureceless draw
This ensures that software draws with different draw properties do
not affect tiling decisions. This avoids an invalidate-redraw loop
if every invalidate leads to resourceless draw(s) with different
draw properties that cause more tiling updates and invalidates.
BUG=577433
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1591513002
Cr-Commit-Position: refs/heads/master@{#371615}
Diffstat (limited to 'cc/trees/layer_tree_host_impl_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 98ef993..98b7c01 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -9146,6 +9146,45 @@ TEST_F(ResourcelessSoftwareLayerTreeHostImplTest, EXPECT_FALSE(last_on_draw_frame_->has_no_damage); } +TEST_F(ResourcelessSoftwareLayerTreeHostImplTest, + ResourcelessSoftwareDrawSkipsUpdateTiles) { + const gfx::Size viewport_size(100, 100); + host_impl_->SetViewportSize(viewport_size); + + host_impl_->CreatePendingTree(); + scoped_refptr<FakeDisplayListRasterSource> raster_source( + FakeDisplayListRasterSource::CreateFilled(viewport_size)); + scoped_ptr<FakePictureLayerImpl> layer( + FakePictureLayerImpl::CreateWithRasterSource(host_impl_->pending_tree(), + 11, raster_source)); + layer->SetBounds(viewport_size); + layer->SetDrawsContent(true); + host_impl_->pending_tree()->SetRootLayer(std::move(layer)); + + host_impl_->pending_tree()->BuildPropertyTreesForTesting(); + host_impl_->ActivateSyncTree(); + + const gfx::Transform draw_transform; + const gfx::Rect draw_viewport(viewport_size); + const gfx::Rect clip(viewport_size); + bool resourceless_software_draw = false; + + // Regular draw causes UpdateTiles. + did_request_prepare_tiles_ = false; + host_impl_->OnDraw(draw_transform, draw_viewport, clip, + resourceless_software_draw); + EXPECT_TRUE(did_request_prepare_tiles_); + host_impl_->PrepareTiles(); + + // Resourceless draw skips UpdateTiles. + const gfx::Rect new_draw_viewport(50, 50); + resourceless_software_draw = true; + did_request_prepare_tiles_ = false; + host_impl_->OnDraw(draw_transform, new_draw_viewport, clip, + resourceless_software_draw); + EXPECT_FALSE(did_request_prepare_tiles_); +} + TEST_F(LayerTreeHostImplTest, ExternalViewportAffectsVisibleRects) { const gfx::Size layer_size(100, 100); SetupScrollAndContentsLayers(layer_size); |