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

Unified Diff: cc/resources/picture_pile_unittest.cc

Issue 1059403002: cc: Make the invalidation frequency buffer bigger. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo 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
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_unittest.cc
diff --git a/cc/resources/picture_pile_unittest.cc b/cc/resources/picture_pile_unittest.cc
index 91ad7ce5d11b10625f3196c1437ff1f90463d90f..bfeb082a12fa6969c60a64022a6f5f8cf456caba 100644
--- a/cc/resources/picture_pile_unittest.cc
+++ b/cc/resources/picture_pile_unittest.cc
@@ -287,6 +287,7 @@ TEST_F(PicturePileTest, StopRecordingOffscreenInvalidations) {
UpdateAndExpandInvalidation(&invalidation, tiling_size(), viewport);
EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString());
+ bool had_tiles_with_no_pictures = false;
for (int i = 0; i < pile_.tiling().num_tiles_x(); ++i) {
for (int j = 0; j < pile_.tiling().num_tiles_y(); ++j) {
FakePicturePile::PictureInfo& picture_info =
@@ -297,13 +298,17 @@ TEST_F(PicturePileTest, StopRecordingOffscreenInvalidations) {
// If the y far enough away we expect to find no picture (no re-recording
// happened). For close y, the picture should change.
- if (j >= 2)
+ if (j >= 3) {
EXPECT_FALSE(picture_info.GetPicture()) << "i " << i << " j " << j;
- else
+ had_tiles_with_no_pictures = true;
+ } else {
EXPECT_TRUE(picture_info.GetPicture()) << "i " << i << " j " << j;
+ }
}
}
+ EXPECT_TRUE(had_tiles_with_no_pictures);
+
// Update a partial tile that doesn't get recorded. We should expand the
// invalidation to the entire tiles that overlap it.
Region small_invalidation =
@@ -360,20 +365,20 @@ TEST_F(PicturePileTest, FrequentInvalidationCanRaster) {
gfx::ToCeiledSize(gfx::ScaleSize(tiling_size(), 4.f));
SetTilingSize(new_tiling_size);
- gfx::Rect tile01_borders = pile_.tiling().TileBoundsWithBorder(0, 1);
gfx::Rect tile02_borders = pile_.tiling().TileBoundsWithBorder(0, 2);
- gfx::Rect tile01_noborders = pile_.tiling().TileBounds(0, 1);
+ gfx::Rect tile03_borders = pile_.tiling().TileBoundsWithBorder(0, 3);
gfx::Rect tile02_noborders = pile_.tiling().TileBounds(0, 2);
+ gfx::Rect tile03_noborders = pile_.tiling().TileBounds(0, 3);
// Sanity check these two tiles are overlapping with borders, since this is
// what the test is trying to repro.
- EXPECT_TRUE(tile01_borders.Intersects(tile02_borders));
- EXPECT_FALSE(tile01_noborders.Intersects(tile02_noborders));
+ EXPECT_TRUE(tile02_borders.Intersects(tile03_borders));
+ EXPECT_FALSE(tile02_noborders.Intersects(tile03_noborders));
UpdateWholePile();
- EXPECT_TRUE(pile_.CanRasterLayerRect(tile01_noborders));
- EXPECT_TRUE(pile_.CanRasterSlowTileCheck(tile01_noborders));
EXPECT_TRUE(pile_.CanRasterLayerRect(tile02_noborders));
EXPECT_TRUE(pile_.CanRasterSlowTileCheck(tile02_noborders));
+ EXPECT_TRUE(pile_.CanRasterLayerRect(tile03_noborders));
+ EXPECT_TRUE(pile_.CanRasterSlowTileCheck(tile03_noborders));
// Sanity check that an initial paint goes down the fast path of having
// a valid recorded viewport.
EXPECT_TRUE(!pile_.recorded_viewport().IsEmpty());
@@ -391,16 +396,16 @@ TEST_F(PicturePileTest, FrequentInvalidationCanRaster) {
// Sanity check some pictures exist and others don't.
EXPECT_TRUE(pile_.picture_map()
- .find(FakePicturePile::PictureMapKey(0, 1))
+ .find(FakePicturePile::PictureMapKey(0, 2))
->second.GetPicture());
EXPECT_FALSE(pile_.picture_map()
- .find(FakePicturePile::PictureMapKey(0, 2))
+ .find(FakePicturePile::PictureMapKey(0, 3))
->second.GetPicture());
- EXPECT_TRUE(pile_.CanRasterLayerRect(tile01_noborders));
- EXPECT_TRUE(pile_.CanRasterSlowTileCheck(tile01_noborders));
- EXPECT_FALSE(pile_.CanRasterLayerRect(tile02_noborders));
- EXPECT_FALSE(pile_.CanRasterSlowTileCheck(tile02_noborders));
+ EXPECT_TRUE(pile_.CanRasterLayerRect(tile02_noborders));
+ EXPECT_TRUE(pile_.CanRasterSlowTileCheck(tile02_noborders));
+ EXPECT_FALSE(pile_.CanRasterLayerRect(tile03_noborders));
+ EXPECT_FALSE(pile_.CanRasterSlowTileCheck(tile03_noborders));
}
TEST_F(PicturePileTest, NoInvalidationValidViewport) {
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698