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 e64191d3b323bd72ddc731835c0c3f742d1be8a0..0795e118f02965efcfee0b9e4fd7b175cf66683d 100644 |
--- a/cc/resources/picture_layer_tiling_unittest.cc |
+++ b/cc/resources/picture_layer_tiling_unittest.cc |
@@ -44,7 +44,9 @@ |
visible_layer_rect, |
layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, |
+ NULL, |
+ gfx::Transform()); |
} |
} |
@@ -538,7 +540,8 @@ |
client.SetTileSize(gfx::Size(100, 100)); |
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); |
// Move viewport down 50 pixels in 0.5 seconds. |
gfx::Rect down_skewport = |
@@ -604,7 +607,8 @@ |
client.set_tree(ACTIVE_TREE); |
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); |
// Move viewport down 50 pixels in 0.5 seconds. |
gfx::Rect down_skewport = |
@@ -671,7 +675,8 @@ |
gfx::Rect viewport_in_content_space = |
gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f)); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 1.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.f, 1.0, NULL, NULL, gfx::Transform()); |
gfx::Rect soon_rect = viewport; |
soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
@@ -755,7 +760,8 @@ |
EXPECT_EQ(25, skewport.width()); |
EXPECT_EQ(35, skewport.height()); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.f, 2.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.f, 2.0, NULL, NULL, gfx::Transform()); |
have_now = false; |
have_eventually = false; |
@@ -806,7 +812,8 @@ |
EXPECT_FLOAT_EQ(4.f, priority.distance_to_visible); |
// Change the underlying layer scale. |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 2.0f, 3.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 2.0f, 3.0, NULL, NULL, gfx::Transform()); |
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
EXPECT_FLOAT_EQ(136.f, priority.distance_to_visible); |
@@ -819,7 +826,8 @@ |
// Test additional scales. |
tiling = TestablePictureLayerTiling::Create(0.2f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 4.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.0f, 4.0, NULL, NULL, gfx::Transform()); |
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
EXPECT_FLOAT_EQ(110.f, priority.distance_to_visible); |
@@ -830,7 +838,8 @@ |
priority = tiling->TileAt(3, 4)->priority(ACTIVE_TREE); |
EXPECT_FLOAT_EQ(60.f, priority.distance_to_visible); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 0.5f, 5.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 0.5f, 5.0, NULL, NULL, gfx::Transform()); |
priority = tiling->TileAt(5, 1)->priority(ACTIVE_TREE); |
EXPECT_FLOAT_EQ(55.f, priority.distance_to_visible); |
@@ -1078,7 +1087,8 @@ |
client.set_tree(ACTIVE_TREE); |
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
EXPECT_FALSE(empty_iterator); |
@@ -1186,9 +1196,10 @@ |
client.set_tree(ACTIVE_TREE); |
tiling = TestablePictureLayerTiling::Create(1.f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion()); |
tiling->UpdateTilePriorities( |
- ACTIVE_TREE, moved_viewport, 1.0f, 2.0, Occlusion()); |
+ ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, moved_viewport, 1.0f, 2.0, NULL, NULL, gfx::Transform()); |
gfx::Rect soon_rect = moved_viewport; |
soon_rect.Inset(-312.f, -312.f, -312.f, -312.f); |
@@ -1261,7 +1272,8 @@ |
client.set_tree(ACTIVE_TREE); |
tiling = TestablePictureLayerTiling::Create(1.0f, layer_bounds, &client); |
- tiling->UpdateTilePriorities(ACTIVE_TREE, viewport, 1.0f, 1.0, Occlusion()); |
+ tiling->UpdateTilePriorities( |
+ ACTIVE_TREE, viewport, 1.0f, 1.0, NULL, NULL, gfx::Transform()); |
PictureLayerTiling::TilingRasterTileIterator empty_iterator; |
EXPECT_FALSE(empty_iterator); |
@@ -1339,15 +1351,19 @@ |
gfx::Rect(layer_bounds), // visible content rect |
1.f, // current contents scale |
1.0, // current frame time |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
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 |
- Occlusion()); |
+ 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)); |
} |
@@ -1365,15 +1381,19 @@ |
gfx::Rect(layer_bounds), // visible content rect |
1.f, // current contents scale |
1.0, // current frame time |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
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 |
- Occlusion()); |
+ 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 |
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
} |
@@ -1390,10 +1410,12 @@ |
client_.set_tree(ACTIVE_TREE); |
tiling_->UpdateTilePriorities(ACTIVE_TREE, |
- viewport_rect, // visible content rect |
- 1.f, // current contents scale |
- 1.0, // current frame time |
- Occlusion()); |
+ 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 |
VerifyTiles(1.f, gfx::Rect(layer_bounds), base::Bind(&TileExists, true)); |
} |
@@ -1420,10 +1442,12 @@ |
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 |
- Occlusion()); |
+ 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 |
VerifyTiles(1.f, |
gfx::Rect(layer_bounds), |
base::Bind(&TilesIntersectingRectExist, visible_rect, true)); |
@@ -1509,7 +1533,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1564,7 +1590,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1629,7 +1657,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1688,7 +1718,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1771,7 +1803,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1864,7 +1898,9 @@ |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -1928,14 +1964,18 @@ |
viewport_in_layer_space, |
last_layer_contents_scale, |
last_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// current frame |
tiling->UpdateTilePriorities(ACTIVE_TREE, |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -2006,14 +2046,18 @@ |
viewport_in_layer_space, |
last_layer_contents_scale, |
last_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// current frame |
tiling->UpdateTilePriorities(ACTIVE_TREE, |
viewport_in_layer_space, |
current_layer_contents_scale, |
current_frame_time_in_seconds, |
- Occlusion()); |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
ASSERT_TRUE(tiling->TileAt(0, 0)); |
ASSERT_TRUE(tiling->TileAt(0, 1)); |
@@ -2042,8 +2086,13 @@ |
tiling = TestablePictureLayerTiling::Create(1.0f, // contents_scale |
gfx::Size(100, 100), |
&client); |
- tiling->UpdateTilePriorities( |
- ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
+ tiling->UpdateTilePriorities(ACTIVE_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 1.0f, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
std::vector<scoped_refptr<Tile> > tiles = tiling->AllRefTilesForTesting(); |
ASSERT_GT(tiles.size(), 0u); |
@@ -2083,8 +2132,13 @@ |
gfx::Size(10000, 10000), |
&active_client); |
// Create all tiles on this tiling. |
- active_tiling->UpdateTilePriorities( |
- ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
+ active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 1.0f, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
FakePictureLayerTilingClient recycle_client; |
recycle_client.SetTileSize(gfx::Size(100, 100)); |
@@ -2098,8 +2152,13 @@ |
&recycle_client); |
// Create all tiles on the second tiling. All tiles should be shared. |
- recycle_tiling->UpdateTilePriorities( |
- PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
+ recycle_tiling->UpdateTilePriorities(PENDING_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 1.0f, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// Set the second tiling as recycled. |
active_client.set_twin_tiling(NULL); |
@@ -2112,15 +2171,25 @@ |
EXPECT_EQ(active_tiling->TileAt(0, 0), recycle_tiling->TileAt(0, 0)); |
// Move the viewport far away from the (0, 0) tile. |
- active_tiling->UpdateTilePriorities( |
- ACTIVE_TREE, gfx::Rect(9000, 9000, 100, 100), 1.0f, 2.0, Occlusion()); |
+ active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
+ gfx::Rect(9000, 9000, 100, 100), |
+ 1.0f, |
+ 2.0, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// Ensure the tile was deleted on both tilings. |
EXPECT_FALSE(active_tiling->TileAt(0, 0)); |
EXPECT_FALSE(recycle_tiling->TileAt(0, 0)); |
// Move the viewport back to (0, 0) tile. |
- active_tiling->UpdateTilePriorities( |
- ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 3.0, Occlusion()); |
+ active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 3.0, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// Ensure that we now have a tile here, but the recycle tiling does not. |
EXPECT_TRUE(active_tiling->TileAt(0, 0)); |
@@ -2137,8 +2206,13 @@ |
gfx::Size(100, 100), |
&active_client); |
// Create all tiles on this tiling. |
- active_tiling->UpdateTilePriorities( |
- ACTIVE_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
+ active_tiling->UpdateTilePriorities(ACTIVE_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 1.0f, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
FakePictureLayerTilingClient recycle_client; |
recycle_client.SetTileSize(gfx::Size(100, 100)); |
@@ -2152,8 +2226,13 @@ |
&recycle_client); |
// Create all tiles on the recycle tiling. All tiles should be shared. |
- recycle_tiling->UpdateTilePriorities( |
- PENDING_TREE, gfx::Rect(0, 0, 100, 100), 1.0f, 1.0f, Occlusion()); |
+ recycle_tiling->UpdateTilePriorities(PENDING_TREE, |
+ gfx::Rect(0, 0, 100, 100), |
+ 1.0f, |
+ 1.0f, |
+ NULL, // occlusion tracker |
+ NULL, // render target |
+ gfx::Transform()); // draw transform |
// Set the second tiling as recycled. |
active_client.set_twin_tiling(NULL); |