Chromium Code Reviews| 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 9743a8239cd02e0af64544c0f9e0f86c481de38b..b14bb4955d888719350ffaf4deaf37dab0df186d 100644 |
| --- a/cc/resources/picture_layer_tiling_unittest.cc |
| +++ b/cc/resources/picture_layer_tiling_unittest.cc |
| @@ -21,10 +21,8 @@ |
| namespace cc { |
| namespace { |
| -static gfx::Rect ViewportInLayerSpace( |
| - const gfx::Transform& transform, |
| - const gfx::Size& device_viewport) { |
| - |
| +static gfx::Rect ViewportInLayerSpace(const gfx::Transform& transform, |
| + const gfx::Size& device_viewport) { |
| gfx::Transform inverse; |
| if (!transform.GetInverse(&inverse)) |
| return gfx::Rect(); |
| @@ -50,6 +48,11 @@ static void UpdateAllTilePriorities(PictureLayerTilingSet* set, |
| } |
| } |
| +static void CreateAllTiles(PictureLayerTilingSet* set) { |
| + for (size_t i = 0; i < set->num_tilings(); ++i) |
| + set->tiling_at(i)->CreateAllTilesForTesting(); |
| +} |
| + |
| class TestablePictureLayerTiling : public PictureLayerTiling { |
| public: |
| using PictureLayerTiling::SetLiveTilesRect; |
| @@ -59,10 +62,8 @@ class TestablePictureLayerTiling : public PictureLayerTiling { |
| float contents_scale, |
| const gfx::Size& layer_bounds, |
| PictureLayerTilingClient* client) { |
| - return make_scoped_ptr(new TestablePictureLayerTiling( |
| - contents_scale, |
| - layer_bounds, |
| - client)); |
| + return make_scoped_ptr( |
| + new TestablePictureLayerTiling(contents_scale, layer_bounds, client)); |
| } |
| using PictureLayerTiling::ComputeSkewport; |
| @@ -71,7 +72,7 @@ class TestablePictureLayerTiling : public PictureLayerTiling { |
| TestablePictureLayerTiling(float contents_scale, |
| const gfx::Size& layer_bounds, |
| PictureLayerTilingClient* client) |
| - : PictureLayerTiling(contents_scale, layer_bounds, client) { } |
| + : PictureLayerTiling(contents_scale, layer_bounds, client) {} |
| }; |
| class PictureLayerTilingIteratorTest : public testing::Test { |
| @@ -83,26 +84,24 @@ class PictureLayerTilingIteratorTest : public testing::Test { |
| float contents_scale, |
| const gfx::Size& layer_bounds) { |
| client_.SetTileSize(tile_size); |
| - tiling_ = TestablePictureLayerTiling::Create(contents_scale, |
| - layer_bounds, |
| - &client_); |
| + tiling_ = TestablePictureLayerTiling::Create( |
| + contents_scale, layer_bounds, &client_); |
| } |
| void SetLiveRectAndVerifyTiles(const gfx::Rect& live_tiles_rect) { |
| + tiling_->CreateAllTilesForTesting(); |
| tiling_->SetLiveTilesRect(live_tiles_rect); |
| std::vector<Tile*> tiles = tiling_->AllTilesForTesting(); |
| - for (std::vector<Tile*>::iterator iter = tiles.begin(); |
| - iter != tiles.end(); |
| + for (std::vector<Tile*>::iterator iter = tiles.begin(); iter != tiles.end(); |
| ++iter) { |
| EXPECT_TRUE(live_tiles_rect.Intersects((*iter)->content_rect())); |
| } |
| } |
| - void VerifyTilesExactlyCoverRect( |
| - float rect_scale, |
| - const gfx::Rect& request_rect, |
| - const gfx::Rect& expect_rect) { |
| + void VerifyTilesExactlyCoverRect(float rect_scale, |
| + const gfx::Rect& request_rect, |
| + const gfx::Rect& expect_rect) { |
| EXPECT_TRUE(request_rect.Contains(expect_rect)); |
| // Iterators are not valid if this ratio is too large (i.e. the |
| @@ -113,8 +112,8 @@ class PictureLayerTilingIteratorTest : public testing::Test { |
| ASSERT_LE(dest_to_contents_scale, 2.0); |
| Region remaining = expect_rect; |
| - for (PictureLayerTiling::CoverageIterator |
| - iter(tiling_.get(), rect_scale, request_rect); |
| + for (PictureLayerTiling::CoverageIterator iter( |
| + tiling_.get(), rect_scale, request_rect); |
| iter; |
| ++iter) { |
| // Geometry cannot overlap previous geometry at all |
| @@ -144,20 +143,17 @@ class PictureLayerTilingIteratorTest : public testing::Test { |
| void VerifyTiles( |
| float rect_scale, |
| const gfx::Rect& rect, |
| - base::Callback<void(Tile* tile, |
| - const gfx::Rect& geometry_rect)> callback) { |
| - VerifyTiles(tiling_.get(), |
| - rect_scale, |
| - rect, |
| - callback); |
| + base::Callback<void(Tile* tile, const gfx::Rect& geometry_rect)> |
| + callback) { |
| + VerifyTiles(tiling_.get(), rect_scale, rect, callback); |
| } |
| void VerifyTiles( |
| PictureLayerTiling* tiling, |
| float rect_scale, |
| const gfx::Rect& rect, |
| - base::Callback<void(Tile* tile, |
| - const gfx::Rect& geometry_rect)> callback) { |
| + base::Callback<void(Tile* tile, const gfx::Rect& geometry_rect)> |
| + callback) { |
| Region remaining = rect; |
| for (PictureLayerTiling::CoverageIterator iter(tiling, rect_scale, rect); |
| iter; |
| @@ -453,6 +449,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { |
| tiling->UpdateTilePriorities( |
| ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); |
| + tiling->CreateInterestRectTilesForTesting(); |
| gfx::Rect soon_rect = viewport; |
| soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
| @@ -501,23 +498,22 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { |
| EXPECT_TRUE(have_eventually); |
| // Spot check some distances. |
| - // Tile at 5, 1 should begin at 41x9 in content space (without borders), |
| + // Tile at 5, 1 should begin at 40x8 in content space (with borders), |
|
vmpstr
2014/07/02 23:51:29
I think it makes sense for us to use bordered rect
|
| // so the distance to a viewport that ends at 25x25 in content space |
| - // should be 17 (41 - 25 + 1). In layer space, then that should be |
| - // 17 / 0.25 = 68 pixels. |
| + // should be 17 (40 - 25 + 1). In layer space, then that should be |
| + // 17 / 0.25 = 64 pixels. |
| - // We can verify that the content rect (with borders) is one pixel off |
| - // 41,9 8x8 on all sides. |
| + // We can verify that the content rect is what we expect it to be. |
| EXPECT_EQ(tiling->TileAt(5, 1)->content_rect().ToString(), "40,8 10x10"); |
| TilePriority priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(68.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(64.f, priority.distance_to_visible); |
| priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(68.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(64.f, priority.distance_to_visible); |
| priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(40.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(32.f, priority.distance_to_visible); |
| // Move the viewport down 40 pixels. |
| viewport = gfx::Rect(0, 40, 100, 100); |
| @@ -537,6 +533,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { |
| tiling->UpdateTilePriorities( |
| ACTIVE_TREE, viewport, 1.f, 2.0, NULL, NULL, gfx::Transform()); |
| + tiling->CreateAllTilesForTesting(); |
| have_now = false; |
| have_eventually = false; |
| @@ -577,10 +574,10 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { |
| EXPECT_TRUE(have_eventually); |
| priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(68.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(64.f, priority.distance_to_visible); |
| priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(28.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(24.f, priority.distance_to_visible); |
| priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
| EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
| @@ -588,12 +585,13 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) { |
| // Change the underlying layer scale. |
| tiling->UpdateTilePriorities( |
| ACTIVE_TREE, viewport, 2.0f, 3.0, NULL, NULL, gfx::Transform()); |
| + tiling->CreateAllTilesForTesting(); |
| priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(34.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(32.f, priority.distance_to_visible); |
| priority = tiling->TileAt(2, 5)->priority(ACTIVE_TREE); |
| - EXPECT_FLOAT_EQ(14.f, priority.distance_to_visible); |
| + EXPECT_FLOAT_EQ(12.f, priority.distance_to_visible); |
| priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
| EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
| @@ -704,7 +702,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedLeft) { |
| TEST(PictureLayerTilingTest, ExpandRectBoundedRight) { |
| gfx::Rect in(40, 50, 100, 200); |
| - gfx::Rect bounds(-1000, -1000, 1000+120, 10000); |
| + gfx::Rect bounds(-1000, -1000, 1000 + 120, 10000); |
| int64 target_area = 200 * 200; |
| gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
| in, target_area, bounds, NULL); |
| @@ -746,7 +744,7 @@ TEST(PictureLayerTilingTest, ExpandRectBoundedBottom) { |
| TEST(PictureLayerTilingTest, ExpandRectSquishedHorizontally) { |
| gfx::Rect in(40, 50, 100, 200); |
| - gfx::Rect bounds(0, -4000, 100+40+20, 100000); |
| + gfx::Rect bounds(0, -4000, 100 + 40 + 20, 100000); |
| int64 target_area = 400 * 400; |
| gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
| in, target_area, bounds, NULL); |
| @@ -754,14 +752,13 @@ TEST(PictureLayerTilingTest, ExpandRectSquishedHorizontally) { |
| EXPECT_EQ(40, in.x() - out.x()); |
| EXPECT_EQ(out.bottom() - in.bottom(), in.y() - out.y()); |
| EXPECT_LE(out.width() * out.height(), target_area); |
| - EXPECT_GT(out.width() * out.height(), |
| - target_area - out.width() * 2); |
| + EXPECT_GT(out.width() * out.height(), target_area - out.width() * 2); |
| EXPECT_TRUE(bounds.Contains(out)); |
| } |
| TEST(PictureLayerTilingTest, ExpandRectSquishedVertically) { |
| gfx::Rect in(40, 50, 100, 200); |
| - gfx::Rect bounds(-4000, 0, 100000, 200+50+30); |
| + gfx::Rect bounds(-4000, 0, 100000, 200 + 50 + 30); |
| int64 target_area = 400 * 400; |
| gfx::Rect out = PictureLayerTiling::ExpandRectEquallyToAreaBoundedBy( |
| in, target_area, bounds, NULL); |
| @@ -769,8 +766,7 @@ TEST(PictureLayerTilingTest, ExpandRectSquishedVertically) { |
| EXPECT_EQ(50, in.y() - out.y()); |
| EXPECT_EQ(out.right() - in.right(), in.x() - out.x()); |
| EXPECT_LE(out.width() * out.height(), target_area); |
| - EXPECT_GT(out.width() * out.height(), |
| - target_area - out.height() * 2); |
| + EXPECT_GT(out.width() * out.height(), target_area - out.height() * 2); |
| EXPECT_TRUE(bounds.Contains(out)); |
| } |
| @@ -836,11 +832,6 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorStaticViewport) { |
| PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
| EXPECT_FALSE(empty_iterator); |
| - std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); |
| - |
| - // Sanity check. |
| - EXPECT_EQ(841u, all_tiles.size()); |
| - |
| // The explanation of each iteration is as follows: |
| // 1. First iteration tests that we can get all of the tiles correctly. |
| // 2. Second iteration ensures that we can get all of the tiles again (first |
| @@ -923,6 +914,10 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorStaticViewport) { |
| EXPECT_TRUE(have_tiles[TilePriority::SOON]); |
| EXPECT_TRUE(have_tiles[TilePriority::EVENTUALLY]); |
| + std::vector<Tile*> all_tiles = tiling->AllTilesForTesting(); |
| + |
| + // Sanity check. |
| + EXPECT_EQ(841u, all_tiles.size()); |
| EXPECT_EQ(unique_tiles.size(), all_tiles.size()); |
| } |
| } |
| @@ -991,7 +986,8 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorMovingViewport) { |
| EXPECT_TRUE(have_tiles[TilePriority::EVENTUALLY]); |
| } |
| -static void TileExists(bool exists, Tile* tile, |
| +static void TileExists(bool exists, |
| + Tile* tile, |
| const gfx::Rect& geometry_rect) { |
| EXPECT_EQ(exists, tile != NULL) << geometry_rect.ToString(); |
| } |
| @@ -1015,6 +1011,7 @@ TEST(PictureLayerTilingTest, TilingEvictionTileIteratorStaticViewport) { |
| tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
| tiling->UpdateTilePriorities( |
| ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
| + tiling->CreateAllTilesForTesting(); |
| PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
| EXPECT_FALSE(empty_iterator); |
| @@ -1072,17 +1069,8 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExist) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling_->CreateAllTilesForTesting(); |
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
| - |
| - // Make the viewport rect empty. All tiles are killed and become zombies. |
| - tiling_->UpdateTilePriorities(ACTIVE_TREE, |
| - gfx::Rect(), // visible content rect |
| - 1.f, // current contents scale |
| - 2.0, // current frame time |
| - NULL, // occlusion tracker |
| - NULL, // render target |
| - gfx::Transform()); // draw transform |
| - VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false)); |
| } |
| TEST_F(PictureLayerTilingIteratorTest, TilesExistGiantViewport) { |
| @@ -1101,6 +1089,7 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExistGiantViewport) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling_->CreateAllTilesForTesting(); |
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
| // If the visible content rect is empty, it should still have live tiles. |
| @@ -1132,6 +1121,7 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExistOutsideViewport) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling_->CreateAllTilesForTesting(); |
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
| } |
| @@ -1163,12 +1153,13 @@ TEST_F(PictureLayerTilingIteratorTest, |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling_->CreateInterestRectTilesForTesting(); |
| VerifyTiles(1.f, |
| gfx::Rect(layer_bounds), |
| base::Bind(&TilesIntersectingRectExist, visible_rect, true)); |
| } |
| -static void CountExistingTiles(int *count, |
| +static void CountExistingTiles(int* count, |
| Tile* tile, |
| const gfx::Rect& geometry_rect) { |
| if (tile != NULL) |
| @@ -1218,10 +1209,11 @@ TEST_F(PictureLayerTilingIteratorTest, AddTilingsToMatchScale) { |
| base::Bind(&TileExists, false)); |
| UpdateAllTilePriorities(&active_set, |
| - PENDING_TREE, |
| + ACTIVE_TREE, |
| gfx::Rect(layer_bounds), // visible content rect |
| 1.f, // current contents scale |
| 1.0); // current frame time |
| + CreateAllTiles(&active_set); |
| // The active tiling has tiles now. |
| VerifyTiles(active_set.tiling_at(0), |
| @@ -1247,6 +1239,7 @@ TEST_F(PictureLayerTilingIteratorTest, AddTilingsToMatchScale) { |
| gfx::Rect(layer_bounds), // visible content rect |
| 1.f, // current contents scale |
| 1.0); // current frame time |
| + CreateAllTiles(&pending_set); |
| VerifyTiles(pending_set.tiling_at(0), |
| 1.f, |
| @@ -1268,8 +1261,8 @@ TEST(UpdateTilePrioritiesTest, VisibleTiles) { |
| gfx::Transform current_screen_transform; |
| double current_frame_time_in_seconds = 1.0; |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1283,6 +1276,7 @@ TEST(UpdateTilePrioritiesTest, VisibleTiles) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1307,9 +1301,8 @@ TEST(UpdateTilePrioritiesTest, VisibleTiles) { |
| } |
| TEST(UpdateTilePrioritiesTest, OffscreenTiles) { |
| - // The TilePriority of offscreen tiles (without movement) should have nonzero |
| - // distance_to_visible and infinite time_to_visible. |
| - |
| + // The TilePriority of offscreen tiles (without movement) should have |
| + // nonzero distance_to_visible and infinite time_to_visible. |
| FakePictureLayerTilingClient client; |
| scoped_ptr<TestablePictureLayerTiling> tiling; |
| @@ -1324,8 +1317,8 @@ TEST(UpdateTilePrioritiesTest, OffscreenTiles) { |
| current_screen_transform.Translate(850, 0); |
| last_screen_transform = current_screen_transform; |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1339,6 +1332,7 @@ TEST(UpdateTilePrioritiesTest, OffscreenTiles) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1375,7 +1369,6 @@ TEST(UpdateTilePrioritiesTest, OffscreenTiles) { |
| TEST(UpdateTilePrioritiesTest, PartiallyOffscreenLayer) { |
| // Sanity check that a layer with some tiles visible and others offscreen has |
| // correct TilePriorities for each tile. |
| - |
| FakePictureLayerTilingClient client; |
| scoped_ptr<TestablePictureLayerTiling> tiling; |
| @@ -1390,8 +1383,8 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenLayer) { |
| current_screen_transform.Translate(705, 505); |
| last_screen_transform = current_screen_transform; |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1405,6 +1398,7 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenLayer) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1450,8 +1444,8 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenRotatedLayer) { |
| current_screen_transform.RotateAboutZAxis(45); |
| last_screen_transform = current_screen_transform; |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1465,6 +1459,7 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenRotatedLayer) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1534,8 +1529,8 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayer) { |
| &clipped); |
| ASSERT_FALSE(clipped); |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1549,6 +1544,7 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayer) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1628,8 +1624,8 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayerClippedByW) { |
| &clipped); |
| ASSERT_FALSE(clipped); |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1643,6 +1639,7 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayerClippedByW) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1692,8 +1689,8 @@ TEST(UpdateTilePrioritiesTest, BasicMotion) { |
| current_screen_transform.Translate(1800, 0); |
| last_screen_transform.Translate(2800, 0); |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1717,6 +1714,7 @@ TEST(UpdateTilePrioritiesTest, BasicMotion) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |
| @@ -1773,8 +1771,8 @@ TEST(UpdateTilePrioritiesTest, RotationMotion) { |
| last_screen_transform.Translate(400, 550); |
| - gfx::Rect viewport_in_layer_space = ViewportInLayerSpace( |
| - current_screen_transform, device_viewport); |
| + gfx::Rect viewport_in_layer_space = |
| + ViewportInLayerSpace(current_screen_transform, device_viewport); |
| client.SetTileSize(gfx::Size(100, 100)); |
| tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
| @@ -1798,6 +1796,7 @@ TEST(UpdateTilePrioritiesTest, RotationMotion) { |
| NULL, // occlusion tracker |
| NULL, // render target |
| gfx::Transform()); // draw transform |
| + tiling->CreateInterestRectTilesForTesting(); |
| ASSERT_TRUE(tiling->TileAt(0, 0)); |
| ASSERT_TRUE(tiling->TileAt(0, 1)); |