| 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 29891d0b4f4038a00c23e0549934d9dd78eef15b..629ffd0999268028cd6a8cd3dbc5df1bf944218c 100644
|
| --- a/cc/resources/picture_layer_tiling_unittest.cc
|
| +++ b/cc/resources/picture_layer_tiling_unittest.cc
|
| @@ -44,9 +44,7 @@ static void UpdateAllTilePriorities(PictureLayerTilingSet* set,
|
| visible_layer_rect,
|
| layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL,
|
| - NULL,
|
| - gfx::Transform());
|
| + OcclusionChecker<LayerImpl>());
|
| }
|
| }
|
|
|
| @@ -541,7 +539,7 @@ TEST(PictureLayerTilingTest, SkewportLimits) {
|
| tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
|
|
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>());
|
|
|
| // Move viewport down 50 pixels in 0.5 seconds.
|
| gfx::Rect down_skewport =
|
| @@ -608,7 +606,7 @@ TEST(PictureLayerTilingTest, ComputeSkewport) {
|
| tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
|
|
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>());
|
|
|
| // Move viewport down 50 pixels in 0.5 seconds.
|
| gfx::Rect down_skewport =
|
| @@ -676,7 +674,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
| gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f));
|
|
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.f, 1.0, OcclusionChecker<LayerImpl>());
|
|
|
| gfx::Rect soon_rect = viewport;
|
| soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
|
| @@ -761,7 +759,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
| EXPECT_EQ(35, skewport.height());
|
|
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.f, 2.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.f, 2.0, OcclusionChecker<LayerImpl>());
|
|
|
| have_now = false;
|
| have_eventually = false;
|
| @@ -813,7 +811,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
|
|
| // Change the underlying layer scale.
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 2.0f, 3.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 2.0f, 3.0, OcclusionChecker<LayerImpl>());
|
|
|
| priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
|
| EXPECT_FLOAT_EQ(136.f, priority.distance_to_visible);
|
| @@ -827,7 +825,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
| // Test additional scales.
|
| tiling = TestablePictureLayerTiling::Create(0.2f, layer_bounds, &client);
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.0f, 4.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.0f, 4.0, OcclusionChecker<LayerImpl>());
|
|
|
| priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
|
| EXPECT_FLOAT_EQ(110.f, priority.distance_to_visible);
|
| @@ -839,7 +837,7 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
|
| EXPECT_FLOAT_EQ(60.f, priority.distance_to_visible);
|
|
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 0.5f, 5.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 0.5f, 5.0, OcclusionChecker<LayerImpl>());
|
|
|
| priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE);
|
| EXPECT_FLOAT_EQ(55.f, priority.distance_to_visible);
|
| @@ -1084,7 +1082,7 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorStaticViewport) {
|
|
|
| tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client);
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>());
|
|
|
| PictureLayerTiling::TilingRasterTileIterator empty_iterator;
|
| EXPECT_FALSE(empty_iterator);
|
| @@ -1193,9 +1191,9 @@ TEST(PictureLayerTilingTest, TilingRasterTileIteratorMovingViewport) {
|
|
|
| tiling = TestablePictureLayerTiling::Create(1.f, layer_bounds, &client);
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>());
|
| tiling->UpdateTilePriorities(
|
| - ACTIVE_TREE, moved_viewport, 1.0f, 2.0, NULL, NULL, gfx::Transform());
|
| + ACTIVE_TREE, moved_viewport, 1.0f, 2.0, OcclusionChecker<LayerImpl>());
|
|
|
| gfx::Rect soon_rect = moved_viewport;
|
| soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
|
| @@ -1269,7 +1267,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());
|
| + ACTIVE_TREE, viewport, 1.0f, 1.0, OcclusionChecker<LayerImpl>());
|
|
|
| PictureLayerTiling::TilingRasterTileIterator empty_iterator;
|
| EXPECT_FALSE(empty_iterator);
|
| @@ -1347,19 +1345,15 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExist) {
|
| 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
|
| + OcclusionChecker<LayerImpl>());
|
| 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
|
| + gfx::Rect(), // visible content rect
|
| + 1.f, // current contents scale
|
| + 2.0, // current frame time
|
| + OcclusionChecker<LayerImpl>());
|
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, false));
|
| }
|
|
|
| @@ -1377,19 +1371,15 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExistGiantViewport) {
|
| 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
|
| + OcclusionChecker<LayerImpl>());
|
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
|
|
|
| // If the visible content rect is empty, it should still have live tiles.
|
| tiling_->UpdateTilePriorities(ACTIVE_TREE,
|
| - giant_rect, // visible content rect
|
| - 1.f, // current contents scale
|
| - 2.0, // current frame time
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + giant_rect, // visible content rect
|
| + 1.f, // current contents scale
|
| + 2.0, // current frame time
|
| + OcclusionChecker<LayerImpl>());
|
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
|
| }
|
|
|
| @@ -1406,12 +1396,10 @@ TEST_F(PictureLayerTilingIteratorTest, TilesExistOutsideViewport) {
|
|
|
| client_.set_tree(ACTIVE_TREE);
|
| tiling_->UpdateTilePriorities(ACTIVE_TREE,
|
| - viewport_rect, // visible content rect
|
| - 1.f, // current contents scale
|
| - 1.0, // current frame time
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + viewport_rect, // visible content rect
|
| + 1.f, // current contents scale
|
| + 1.0, // current frame time
|
| + OcclusionChecker<LayerImpl>());
|
| VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true));
|
| }
|
|
|
| @@ -1438,12 +1426,10 @@ TEST_F(PictureLayerTilingIteratorTest,
|
| client_.set_tree(ACTIVE_TREE);
|
| set_max_tiles_for_interest_area(1);
|
| tiling_->UpdateTilePriorities(ACTIVE_TREE,
|
| - visible_rect, // visible content rect
|
| - 1.f, // current contents scale
|
| - 1.0, // current frame time
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + visible_rect, // visible content rect
|
| + 1.f, // current contents scale
|
| + 1.0, // current frame time
|
| + OcclusionChecker<LayerImpl>());
|
| VerifyTiles(1.f,
|
| gfx::Rect(layer_bounds),
|
| base::Bind(&TilesIntersectingRectExist, visible_rect, true));
|
| @@ -1470,9 +1456,7 @@ TEST_F(PictureLayerTilingIteratorTest,
|
| 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
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| int num_tiles = 0;
|
| VerifyTiles(1.f,
|
| @@ -1564,9 +1548,7 @@ TEST(UpdateTilePrioritiesTest, VisibleTiles) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1621,9 +1603,7 @@ TEST(UpdateTilePrioritiesTest, OffscreenTiles) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1688,9 +1668,7 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenLayer) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1749,9 +1727,7 @@ TEST(UpdateTilePrioritiesTest, PartiallyOffscreenRotatedLayer) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1834,9 +1810,7 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayer) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1929,9 +1903,7 @@ TEST(UpdateTilePrioritiesTest, PerspectiveLayerClippedByW) {
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -1995,18 +1967,14 @@ TEST(UpdateTilePrioritiesTest, BasicMotion) {
|
| viewport_in_layer_space,
|
| last_layer_contents_scale,
|
| last_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| // current frame
|
| tiling->UpdateTilePriorities(ACTIVE_TREE,
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -2077,18 +2045,14 @@ TEST(UpdateTilePrioritiesTest, RotationMotion) {
|
| viewport_in_layer_space,
|
| last_layer_contents_scale,
|
| last_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| // current frame
|
| tiling->UpdateTilePriorities(ACTIVE_TREE,
|
| viewport_in_layer_space,
|
| current_layer_contents_scale,
|
| current_frame_time_in_seconds,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| ASSERT_TRUE(tiling->TileAt(0, 0));
|
| ASSERT_TRUE(tiling->TileAt(0, 1));
|
| @@ -2121,9 +2085,7 @@ TEST(PictureLayerTilingTest, ResetClearsPriorities) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 1.0f,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting();
|
| ASSERT_GT(tiles.size(), 0u);
|
| @@ -2167,9 +2129,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 1.0f,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| FakePictureLayerTilingClient recycle_client;
|
| recycle_client.SetTileSize(gfx::Size(100, 100));
|
| @@ -2187,9 +2147,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 1.0f,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| // Set the second tiling as recycled.
|
| active_client.set_twin_tiling(NULL);
|
| @@ -2206,9 +2164,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
| gfx::Rect(9000, 9000, 100, 100),
|
| 1.0f,
|
| 2.0,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
| // Ensure the tile was deleted on both tilings.
|
| EXPECT_FALSE(active_tiling->TileAt(0, 0));
|
| EXPECT_FALSE(recycle_tiling->TileAt(0, 0));
|
| @@ -2218,9 +2174,7 @@ TEST(PictureLayerTilingTest, RecycledTilesCleared) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 3.0,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| // Ensure that we now have a tile here, but the recycle tiling does not.
|
| EXPECT_TRUE(active_tiling->TileAt(0, 0));
|
| @@ -2241,9 +2195,7 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 1.0f,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| FakePictureLayerTilingClient recycle_client;
|
| recycle_client.SetTileSize(gfx::Size(100, 100));
|
| @@ -2261,9 +2213,7 @@ TEST(PictureLayerTilingTest, RecycledTilesClearedOnReset) {
|
| gfx::Rect(0, 0, 100, 100),
|
| 1.0f,
|
| 1.0f,
|
| - NULL, // occlusion tracker
|
| - NULL, // render target
|
| - gfx::Transform()); // draw transform
|
| + OcclusionChecker<LayerImpl>());
|
|
|
| // Set the second tiling as recycled.
|
| active_client.set_twin_tiling(NULL);
|
|
|