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

Unified Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 555643002: cc: Changed ComputeExpansionDelta to never return a delta less than zero (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete unused function 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/resources/picture_layer_tiling.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_layer_tiling_unittest.cc
diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc
index 990cdd4708455d1a4e57cd2179b7fd45ad5c0b6b..0795e118f02965efcfee0b9e4fd7b175cf66683d 100644
--- a/cc/resources/picture_layer_tiling_unittest.cc
+++ b/cc/resources/picture_layer_tiling_unittest.cc
@@ -869,7 +869,11 @@ TEST(PictureLayerTilingTest, ExpandRectSmaller) {
EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y());
EXPECT_EQ(out.right() - in.right(), in.x() - out.x());
EXPECT_EQ(out.width() - in.width(), out.height() - in.height());
- EXPECT_NEAR(100 * 100, out.width() * out.height(), 50);
+
+ // |in| represents the visible rect, and |out| represents the eventually rect.
+ // If the eventually rect doesn't contain the visible rect, we will start
+ // losing tiles.
+ EXPECT_TRUE(out.Contains(in));
EXPECT_TRUE(bounds.Contains(out));
}
@@ -1449,41 +1453,6 @@ TEST_F(PictureLayerTilingIteratorTest,
base::Bind(&TilesIntersectingRectExist, visible_rect, true));
}
-static void CountExistingTiles(int *count,
- Tile* tile,
- const gfx::Rect& geometry_rect) {
- if (tile != NULL)
- ++(*count);
-}
-
-TEST_F(PictureLayerTilingIteratorTest,
- TilesExistLargeViewportAndLayerWithLargeVisibleArea) {
- gfx::Size layer_bounds(10000, 10000);
- Initialize(gfx::Size(100, 100), 1.f, layer_bounds);
- VerifyTilesExactlyCoverRect(1.f, gfx::Rect(layer_bounds));
- VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false));
-
- client_.set_tree(ACTIVE_TREE);
- set_max_tiles_for_interest_area(1);
- tiling_->UpdateTilePriorities(
- ACTIVE_TREE,
- gfx::Rect(layer_bounds), // visible content rect
- 1.f, // current contents scale
- 1.0, // current frame time
- NULL, // occlusion tracker
- NULL, // render target
- gfx::Transform()); // draw transform
-
- int num_tiles = 0;
- VerifyTiles(1.f,
- gfx::Rect(layer_bounds),
- base::Bind(&CountExistingTiles, &num_tiles));
- // If we're making a rect the size of one tile, it can only overlap up to 4
- // tiles depending on its position.
- EXPECT_LE(num_tiles, 4);
- VerifyTiles(1.f, gfx::Rect(), base::Bind(&TileExists, false));
-}
-
TEST_F(PictureLayerTilingIteratorTest, AddTilingsToMatchScale) {
gfx::Size layer_bounds(1099, 801);
gfx::Size tile_size(100, 100);
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698