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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 23171014: Fix UpdateTilePriorities viewport in Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to 221292 Created 7 years, 3 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.cc ('k') | cc/output/delegating_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 09c438d8c9be02cb1aa05746c85dfae9b93fb2f7..a64b9d672f2b3d7672f312156ca2063f81020434 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -241,6 +241,51 @@ TEST_F(PictureLayerImplTest, CloneNoInvalidation) {
VerifyAllTilesExistAndHavePile(tilings->tiling_at(i), active_pile.get());
}
+TEST_F(PictureLayerImplTest, SuppressUpdateTilePriorities) {
+ base::TimeTicks time_ticks;
+ host_impl_.SetCurrentFrameTimeTicks(time_ticks);
+
+ gfx::Size tile_size(100, 100);
+ gfx::Size layer_bounds(400, 400);
+
+ scoped_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ scoped_refptr<FakePicturePileImpl> active_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+
+ SetupTrees(pending_pile, active_pile);
+
+ Region invalidation;
+ AddDefaultTilingsWithInvalidation(invalidation);
+ EXPECT_TRUE(host_impl_.manage_tiles_needed());
+ active_layer_->UpdateTilePriorities();
+ host_impl_.ManageTiles();
+ EXPECT_FALSE(host_impl_.manage_tiles_needed());
+
+ time_ticks += base::TimeDelta::FromMilliseconds(200);
+ host_impl_.SetCurrentFrameTimeTicks(time_ticks);
+
+ // Setting this boolean should cause an early out in UpdateTilePriorities.
+ bool valid_for_tile_management = false;
+ host_impl_.SetExternalDrawConstraints(gfx::Transform(),
+ gfx::Rect(layer_bounds),
+ gfx::Rect(layer_bounds),
+ valid_for_tile_management);
+ active_layer_->UpdateTilePriorities();
+ EXPECT_FALSE(host_impl_.manage_tiles_needed());
+
+ time_ticks += base::TimeDelta::FromMilliseconds(200);
+ host_impl_.SetCurrentFrameTimeTicks(time_ticks);
+
+ valid_for_tile_management = true;
+ host_impl_.SetExternalDrawConstraints(gfx::Transform(),
+ gfx::Rect(layer_bounds),
+ gfx::Rect(layer_bounds),
+ valid_for_tile_management);
+ active_layer_->UpdateTilePriorities();
+ EXPECT_TRUE(host_impl_.manage_tiles_needed());
+}
+
TEST_F(PictureLayerImplTest, ClonePartialInvalidation) {
gfx::Size tile_size(100, 100);
gfx::Size layer_bounds(400, 400);
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/output/delegating_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698