Chromium Code Reviews| Index: cc/tiles/picture_layer_tiling_unittest.cc |
| diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc |
| index ec3b87024d78931c0df77bd8fef84c3b76646fd1..6a75a6259dbbd8c540f4156926948cf13125db54 100644 |
| --- a/cc/tiles/picture_layer_tiling_unittest.cc |
| +++ b/cc/tiles/picture_layer_tiling_unittest.cc |
| @@ -1796,5 +1796,54 @@ TEST_F(PictureLayerTilingIteratorTest, GiantRect) { |
| VerifyTilesExactlyCoverRect(contents_scale, content_rect); |
| } |
| +TEST_F(PictureLayerTilingIteratorTest, |
| + InvalidatedIdRespectsEnabledPartialRaster) { |
| + // Verifies that a resize with invalidation for newly exposed pixels will |
| + // deletes tiles that intersect that invalidation. |
| + gfx::Size tile_size(100, 100); |
| + gfx::Size original_layer_size(10, 10); |
| + client_.SetTileSize(tile_size); |
| + scoped_refptr<FakeDisplayListRasterSource> raster_source = |
| + FakeDisplayListRasterSource::CreateFilled(original_layer_size); |
| + LayerTreeSettings settings; |
| + settings.enable_partial_raster = true; |
| + tiling_ = TestablePictureLayerTiling::Create(ACTIVE_TREE, 1.f, raster_source, |
| + &client_, settings); |
| + tiling_->set_resolution(HIGH_RESOLUTION); |
| + SetLiveRectAndVerifyTiles(gfx::Rect(original_layer_size)); |
| + |
| + // Tiling only has one tile, since its total size is less than one. |
| + EXPECT_TRUE(tiling_->TileAt(0, 0)); |
| + |
| + Region invalidation = |
| + SubtractRegions(gfx::Rect(tile_size), gfx::Rect(original_layer_size)); |
| + |
| + EXPECT_TRUE(tiling_->TileAt(0, 0)); |
| + EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); |
|
vmpstr
2015/10/06 18:35:49
can you make this EXPECT_EQ(0, ...);
ericrk
2015/10/07 17:59:08
Done.
|
| + tiling_->Invalidate(invalidation); |
| + EXPECT_TRUE(tiling_->TileAt(0, 0)->invalidated_id()); |
|
vmpstr
2015/10/06 18:35:49
Can you save off the original tile id and EXPECT_E
ericrk
2015/10/07 17:59:08
Done.
|
| +} |
| + |
| +TEST_F(PictureLayerTilingIteratorTest, |
| + InvalidatedIdRespectsDisabledPartialRaster) { |
| + // Verifies that a resize with invalidation for newly exposed pixels will |
| + // deletes tiles that intersect that invalidation. |
| + gfx::Size tile_size(100, 100); |
| + gfx::Size original_layer_size(10, 10); |
| + InitializeActive(tile_size, 1.f, original_layer_size); |
| + SetLiveRectAndVerifyTiles(gfx::Rect(original_layer_size)); |
| + |
| + // Tiling only has one tile, since its total size is less than one. |
| + EXPECT_TRUE(tiling_->TileAt(0, 0)); |
| + |
| + Region invalidation = |
| + SubtractRegions(gfx::Rect(tile_size), gfx::Rect(original_layer_size)); |
| + |
| + EXPECT_TRUE(tiling_->TileAt(0, 0)); |
| + EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); |
|
vmpstr
2015/10/06 18:35:49
Same here.
ericrk
2015/10/07 17:59:08
Done.
|
| + tiling_->Invalidate(invalidation); |
| + EXPECT_FALSE(tiling_->TileAt(0, 0)->invalidated_id()); |
| +} |
| + |
| } // namespace |
| } // namespace cc |