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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 555183002: cc: Fix layer raster tile iterator not to skip a tile erroneously. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK, cleaned up unit test Created 6 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') | no next file » | 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 bd6a8f7f479f7fd466a466cfadcbf30597a07103..44662d7b2baaec06c2b980d211971ecbc7c7b3b1 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -2498,6 +2498,11 @@ TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForGpuRasterization) {
}
TEST_F(PictureLayerImplTest, LayerRasterTileIterator) {
+ base::TimeTicks time_ticks;
+ time_ticks += base::TimeDelta::FromMilliseconds(1);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+
gfx::Size tile_size(100, 100);
gfx::Size layer_bounds(1000, 1000);
@@ -2563,6 +2568,45 @@ TEST_F(PictureLayerImplTest, LayerRasterTileIterator) {
EXPECT_EQ(low_res_tile_count + high_res_tile_count + non_ideal_tile_count,
unique_tiles.size());
+ // No NOW tiles.
+ time_ticks += base::TimeDelta::FromMilliseconds(200);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+
+ pending_layer_->draw_properties().visible_content_rect =
vmpstr 2014/09/10 15:49:05 This works. I just wanted it to be a simple one li
+ gfx::Rect(1100, 1100, 500, 500);
+ pending_layer_->UpdateTiles(NULL);
+
+ unique_tiles.clear();
+ high_res_tile_count = 0u;
+ for (it = PictureLayerImpl::LayerRasterTileIterator(pending_layer_, false);
+ it;
+ ++it) {
+ Tile* tile = *it;
+ TilePriority priority = tile->priority(PENDING_TREE);
+
+ EXPECT_TRUE(tile);
+
+ // Non-high res tiles only get visible tiles.
+ EXPECT_EQ(HIGH_RESOLUTION, priority.resolution);
+ EXPECT_NE(TilePriority::NOW, priority.priority_bin);
+
+ high_res_tile_count += priority.resolution == HIGH_RESOLUTION;
+
+ unique_tiles.insert(tile);
+ }
+
+ EXPECT_EQ(16u, high_res_tile_count);
+ EXPECT_EQ(high_res_tile_count, unique_tiles.size());
+
+ time_ticks += base::TimeDelta::FromMilliseconds(200);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(time_ticks));
+
+ pending_layer_->draw_properties().visible_content_rect =
+ gfx::Rect(0, 0, 500, 500);
+ pending_layer_->UpdateTiles(NULL);
+
std::vector<Tile*> high_res_tiles = high_res_tiling->AllTilesForTesting();
for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin();
tile_it != high_res_tiles.end();
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698