summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_impl_unittest.cc
diff options
context:
space:
mode:
authorboliu <boliu@chromium.org>2016-02-08 13:58:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-08 21:59:28 +0000
commit5a1970d3aafbf7b9dd5eacad3d0a774c22bdffcd (patch)
treee2fc1f09c63387bd887106227592e829280b764c /cc/trees/layer_tree_host_impl_unittest.cc
parentaa65dc19be4632a4e36c20133431ebb23f13c735 (diff)
downloadchromium_src-5a1970d3aafbf7b9dd5eacad3d0a774c22bdffcd.zip
chromium_src-5a1970d3aafbf7b9dd5eacad3d0a774c22bdffcd.tar.gz
chromium_src-5a1970d3aafbf7b9dd5eacad3d0a774c22bdffcd.tar.bz2
cc: Update pending tree when external constraints change
External tile constraint updates should update draw properties in pending tree. Otherwise it's possible that pending tree remains out of sync even after activation. Not the external draw properties do not need to be updated since activation does not by itself update active tree draw properties. BUG=552398 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1672453002 Cr-Commit-Position: refs/heads/master@{#374194}
Diffstat (limited to 'cc/trees/layer_tree_host_impl_unittest.cc')
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index fe913c3..600047c 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -9009,6 +9009,40 @@ TEST_F(ResourcelessSoftwareLayerTreeHostImplTest,
EXPECT_FALSE(did_request_prepare_tiles_);
}
+TEST_F(LayerTreeHostImplTest, ExternalTileConstraintReflectedInPendingTree) {
+ EXPECT_FALSE(host_impl_->CommitToActiveTree());
+ const gfx::Size layer_size(100, 100);
+ host_impl_->SetViewportSize(layer_size);
+ bool update_lcd_text = false;
+
+ // Set up active and pending tree.
+ host_impl_->CreatePendingTree();
+ host_impl_->pending_tree()->SetRootLayer(
+ LayerImpl::Create(host_impl_->pending_tree(), 1));
+ host_impl_->pending_tree()->BuildPropertyTreesForTesting();
+ host_impl_->pending_tree()->UpdateDrawProperties(update_lcd_text);
+
+ host_impl_->ActivateSyncTree();
+ host_impl_->active_tree()->BuildPropertyTreesForTesting();
+ host_impl_->active_tree()->UpdateDrawProperties(update_lcd_text);
+
+ host_impl_->CreatePendingTree();
+ host_impl_->pending_tree()->UpdateDrawProperties(update_lcd_text);
+ host_impl_->active_tree()->UpdateDrawProperties(update_lcd_text);
+
+ EXPECT_FALSE(host_impl_->pending_tree()->needs_update_draw_properties());
+ EXPECT_FALSE(host_impl_->active_tree()->needs_update_draw_properties());
+
+ // Update external constraints should set_needs_update_draw_properties on
+ // both trees.
+ gfx::Transform external_transform;
+ gfx::Rect external_viewport(10, 20);
+ host_impl_->SetExternalTilePriorityConstraints(external_viewport,
+ external_transform);
+ EXPECT_TRUE(host_impl_->pending_tree()->needs_update_draw_properties());
+ EXPECT_TRUE(host_impl_->active_tree()->needs_update_draw_properties());
+}
+
TEST_F(LayerTreeHostImplTest, ExternalViewportAffectsVisibleRects) {
const gfx::Size layer_size(100, 100);
SetupScrollAndContentsLayers(layer_size);