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

Unified Diff: cc/resources/picture_layer_tiling_set_unittest.cc

Issue 1041893003: cc: Separate tiling set functionality into explicit separate functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
Index: cc/resources/picture_layer_tiling_set_unittest.cc
diff --git a/cc/resources/picture_layer_tiling_set_unittest.cc b/cc/resources/picture_layer_tiling_set_unittest.cc
index 3cafa4c64bd2f2903342e7fad9edb42009028aef..6df81b0640dc9277ab7abb64e7efa5127486e83e 100644
--- a/cc/resources/picture_layer_tiling_set_unittest.cc
+++ b/cc/resources/picture_layer_tiling_set_unittest.cc
@@ -337,8 +337,8 @@ TEST(PictureLayerTilingSetTest, TileSizeChange) {
// Update to a new source frame with a new tile size.
pending_client.SetTileSize(tile_size2);
- pending_set->UpdateTilingsToCurrentRasterSource(pile.get(), nullptr, Region(),
- 1.f, 1.f);
+ pending_set->UpdateTilingsToCurrentRasterSourceForCommit(pile.get(),
+ Region());
// The tiling should get the correct tile size.
EXPECT_EQ(tile_size2, pending_set->tiling_at(0)->tile_size());
@@ -355,8 +355,8 @@ TEST(PictureLayerTilingSetTest, TileSizeChange) {
// Clone from the pending to the active tree.
active_client.SetTileSize(tile_size2);
- active_set->UpdateTilingsToCurrentRasterSource(pile.get(), pending_set.get(),
- Region(), 1.f, 1.f);
+ active_set->UpdateTilingsToCurrentRasterSourceForActivation(
+ pile.get(), pending_set.get(), Region());
// The active tiling should get the right tile size.
EXPECT_EQ(tile_size2, active_set->tiling_at(0)->tile_size());
@@ -369,8 +369,8 @@ TEST(PictureLayerTilingSetTest, TileSizeChange) {
// A new source frame with a new tile size.
pending_client.SetTileSize(tile_size3);
- pending_set->UpdateTilingsToCurrentRasterSource(pile.get(), nullptr, Region(),
- 1.f, 1.f);
+ pending_set->UpdateTilingsToCurrentRasterSourceForCommit(pile.get(),
+ Region());
// The tiling gets the new size correctly.
EXPECT_EQ(tile_size3, pending_set->tiling_at(0)->tile_size());
@@ -387,8 +387,8 @@ TEST(PictureLayerTilingSetTest, TileSizeChange) {
// Now we activate with a different tile size for the active tiling.
active_client.SetTileSize(tile_size3);
- active_set->UpdateTilingsToCurrentRasterSource(pile.get(), pending_set.get(),
- Region(), 1.f, 1.f);
+ active_set->UpdateTilingsToCurrentRasterSourceForActivation(
+ pile.get(), pending_set.get(), Region());
// The active tiling changes its tile size.
EXPECT_EQ(tile_size3, active_set->tiling_at(0)->tile_size());
@@ -423,30 +423,35 @@ TEST(PictureLayerTilingSetTest, MaxContentScale) {
// Update to a new source frame with a max content scale that is larger than
// everything.
float max_content_scale = 3.f;
- pending_set->UpdateTilingsToCurrentRasterSource(pile.get(), nullptr, Region(),
- 1.f, max_content_scale);
+ pending_set->UpdateTilingsToCurrentRasterSourceForCommit(pile.get(),
+ Region());
+
// All the tilings are there still.
EXPECT_EQ(3u, pending_set->num_tilings());
// Clone from the pending to the active tree with the same max content size.
- active_set->UpdateTilingsToCurrentRasterSource(
- pile.get(), pending_set.get(), Region(), 1.f, max_content_scale);
+ active_set->UpdateTilingsToCurrentRasterSourceForActivation(
+ pile.get(), pending_set.get(), Region());
// All the tilings are on the active tree.
EXPECT_EQ(3u, active_set->num_tilings());
// Update to a new source frame with a max content scale that will drop one
enne (OOO) 2015/03/31 19:53:02 This test no longer really makes any sense, since
vmpstr 2015/04/01 23:53:41 Changed it back with RemoveTilings being a part of
// tiling.
max_content_scale = 2.9f;
- pending_set->UpdateTilingsToCurrentRasterSource(pile.get(), nullptr, Region(),
- 1.f, max_content_scale);
+ pending_set->RemoveTilingsBelowScale(1.f);
+ pending_set->RemoveTilingsAboveScale(max_content_scale);
+ pending_set->UpdateTilingsToCurrentRasterSourceForCommit(pile.get(),
+ Region());
// All the tilings are there still.
EXPECT_EQ(2u, pending_set->num_tilings());
pending_set->tiling_at(0)->set_resolution(HIGH_RESOLUTION);
// Clone from the pending to the active tree with the same max content size.
- active_set->UpdateTilingsToCurrentRasterSource(
- pile.get(), pending_set.get(), Region(), 1.f, max_content_scale);
+ active_set->RemoveTilingsBelowScale(1.f);
+ active_set->RemoveTilingsAboveScale(max_content_scale);
+ active_set->UpdateTilingsToCurrentRasterSourceForActivation(
+ pile.get(), pending_set.get(), Region());
// All the tilings are on the active tree.
EXPECT_EQ(2u, active_set->num_tilings());
}
« cc/layers/picture_layer_impl.cc ('K') | « cc/resources/picture_layer_tiling_set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698