| 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 96862ec3118b828cf909f603e4d22e4822bc8b7d..0a356310478bcdc63ce847ab8f912993ba3a42a1 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;
|
| @@ -481,6 +477,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);
|
| @@ -529,23 +526,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),
|
| // 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);
|
| @@ -565,6 +561,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;
|
| @@ -605,10 +602,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);
|
| @@ -616,12 +613,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);
|
| @@ -732,7 +730,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);
|
| @@ -774,7 +772,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);
|
| @@ -782,14 +780,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);
|
| @@ -797,8 +794,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));
|
| }
|
|
|
| @@ -864,11 +860,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
|
| @@ -951,6 +942,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());
|
| }
|
| }
|
| @@ -1019,7 +1014,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();
|
| }
|
| @@ -1043,6 +1039,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);
|
| @@ -1100,17 +1097,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) {
|
| @@ -1129,6 +1117,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.
|
| @@ -1139,6 +1128,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));
|
| }
|
|
|
| @@ -1160,6 +1150,7 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExistOutsideViewport) {
|
| NULL, // occlusion tracker
|
| NULL, // render target
|
| gfx::Transform()); // draw transform
|
| + tiling_->CreateInterestRectTilesForTesting();
|
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
|
| }
|
|
|
| @@ -1191,12 +1182,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)
|
| @@ -1246,10 +1238,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),
|
| @@ -1275,6 +1268,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,
|
| @@ -1296,8 +1290,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
|
| @@ -1311,6 +1305,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));
|
| @@ -1335,9 +1330,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;
|
|
|
| @@ -1352,8 +1346,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
|
| @@ -1367,6 +1361,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));
|
| @@ -1403,7 +1398,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;
|
|
|
| @@ -1418,8 +1412,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
|
| @@ -1433,6 +1427,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));
|
| @@ -1478,8 +1473,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
|
| @@ -1493,6 +1488,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));
|
| @@ -1562,8 +1558,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
|
| @@ -1577,6 +1573,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));
|
| @@ -1656,8 +1653,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
|
| @@ -1671,6 +1668,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));
|
| @@ -1720,8 +1718,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
|
| @@ -1745,6 +1743,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));
|
| @@ -1801,8 +1800,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
|
| @@ -1826,6 +1825,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));
|
|
|