Index: cc/resources/tile_manager_unittest.cc |
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc |
index 972a83918547f8819084f6381f1cab6a9481b0fa..9b962d329f6b23d04ce7e61ebc4611364fae9b5f 100644 |
--- a/cc/resources/tile_manager_unittest.cc |
+++ b/cc/resources/tile_manager_unittest.cc |
@@ -662,7 +662,7 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) { |
Tile* last_tile = NULL; |
smoothness_tiles.clear(); |
tile_count = 0; |
- // Here we expect to get increasing ACTIVE_TREE priority_bin. |
+ // Here we expect to get increasing combined priority_bin. |
queue = host_impl_.BuildEvictionQueue(SMOOTHNESS_TAKES_PRIORITY); |
int distance_increasing = 0; |
int distance_decreasing = 0; |
@@ -674,16 +674,16 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) { |
if (!last_tile) |
last_tile = tile; |
- EXPECT_GE(last_tile->priority(ACTIVE_TREE).priority_bin, |
- tile->priority(ACTIVE_TREE).priority_bin); |
- if (last_tile->priority(ACTIVE_TREE).priority_bin == |
- tile->priority(ACTIVE_TREE).priority_bin) { |
+ const TilePriority& last_priority = last_tile->combined_priority(); |
+ const TilePriority& priority = tile->combined_priority(); |
+ |
+ EXPECT_GE(last_priority.priority_bin, priority.priority_bin); |
+ if (last_priority.priority_bin == priority.priority_bin) { |
EXPECT_LE(last_tile->required_for_activation(), |
tile->required_for_activation()); |
if (last_tile->required_for_activation() == |
tile->required_for_activation()) { |
- if (last_tile->priority(ACTIVE_TREE).distance_to_visible >= |
- tile->priority(ACTIVE_TREE).distance_to_visible) |
+ if (last_priority.distance_to_visible >= priority.distance_to_visible) |
++distance_decreasing; |
else |
++distance_increasing; |
@@ -704,7 +704,7 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) { |
std::set<Tile*> new_content_tiles; |
last_tile = NULL; |
- // Here we expect to get increasing PENDING_TREE priority_bin. |
+ // Again, we expect to get increasing combined priority_bin. |
queue = host_impl_.BuildEvictionQueue(NEW_CONTENT_TAKES_PRIORITY); |
distance_decreasing = 0; |
distance_increasing = 0; |
@@ -715,16 +715,16 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) { |
if (!last_tile) |
last_tile = tile; |
- EXPECT_GE(last_tile->priority(PENDING_TREE).priority_bin, |
- tile->priority(PENDING_TREE).priority_bin); |
- if (last_tile->priority(PENDING_TREE).priority_bin == |
- tile->priority(PENDING_TREE).priority_bin) { |
+ const TilePriority& last_priority = last_tile->combined_priority(); |
+ const TilePriority& priority = tile->combined_priority(); |
+ |
+ EXPECT_GE(last_priority.priority_bin, priority.priority_bin); |
+ if (last_priority.priority_bin == priority.priority_bin) { |
EXPECT_LE(last_tile->required_for_activation(), |
tile->required_for_activation()); |
if (last_tile->required_for_activation() == |
tile->required_for_activation()) { |
- if (last_tile->priority(PENDING_TREE).distance_to_visible >= |
- tile->priority(PENDING_TREE).distance_to_visible) |
+ if (last_priority.distance_to_visible >= priority.distance_to_visible) |
++distance_decreasing; |
else |
++distance_increasing; |
@@ -773,6 +773,12 @@ TEST_F(TileManagerTilePriorityQueueTest, |
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
host_impl_.pending_tree()->UpdateDrawProperties(); |
+ ActivateTree(); |
+ SetupPendingTree(pending_pile); |
+ |
+ FakePictureLayerImpl* active_child_layer = |
+ static_cast<FakePictureLayerImpl*>(active_layer_->children()[0]); |
+ |
std::set<Tile*> all_tiles; |
size_t tile_count = 0; |
scoped_ptr<RasterTilePriorityQueue> raster_queue(host_impl_.BuildRasterQueue( |
@@ -799,6 +805,15 @@ TEST_F(TileManagerTilePriorityQueueTest, |
pending_child_layer->LowResTiling()->ComputeTilePriorityRects( |
viewport, 1.0f, 1.0, Occlusion()); |
+ active_layer_->HighResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, |
+ Occlusion()); |
+ active_layer_->LowResTiling()->ComputeTilePriorityRects(viewport, 1.0f, 1.0, |
+ Occlusion()); |
+ active_child_layer->HighResTiling()->ComputeTilePriorityRects( |
+ viewport, 1.0f, 1.0, Occlusion()); |
+ active_child_layer->LowResTiling()->ComputeTilePriorityRects( |
+ viewport, 1.0f, 1.0, Occlusion()); |
+ |
// Populate all tiles directly from the tilings. |
all_tiles.clear(); |
std::vector<Tile*> pending_high_res_tiles = |
@@ -814,12 +829,14 @@ TEST_F(TileManagerTilePriorityQueueTest, |
std::vector<Tile*> pending_child_high_res_tiles = |
pending_child_layer->HighResTiling()->AllTilesForTesting(); |
pending_child_layer->HighResTiling()->SetAllTilesOccludedForTesting(); |
+ active_child_layer->HighResTiling()->SetAllTilesOccludedForTesting(); |
all_tiles.insert(pending_child_high_res_tiles.begin(), |
pending_child_high_res_tiles.end()); |
std::vector<Tile*> pending_child_low_res_tiles = |
pending_child_layer->LowResTiling()->AllTilesForTesting(); |
pending_child_layer->LowResTiling()->SetAllTilesOccludedForTesting(); |
+ active_child_layer->LowResTiling()->SetAllTilesOccludedForTesting(); |
all_tiles.insert(pending_child_low_res_tiles.begin(), |
pending_child_low_res_tiles.end()); |
@@ -837,7 +854,7 @@ TEST_F(TileManagerTilePriorityQueueTest, |
if (!last_tile) |
last_tile = tile; |
- bool tile_is_occluded = tile->is_occluded_for_tree_priority(tree_priority); |
+ bool tile_is_occluded = tile->is_occluded_combined(); |
// The only way we will encounter an occluded tile after an unoccluded |
// tile is if the priorty bin decreased, the tile is required for |