| Index: cc/resources/tile_manager_unittest.cc
|
| diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
|
| index 4b4b92c9d57bf5fe2cc110a151d98ecc611f14a3..dbd73705b3105ffdca4c30e8c530b85c23a87e2d 100644
|
| --- a/cc/resources/tile_manager_unittest.cc
|
| +++ b/cc/resources/tile_manager_unittest.cc
|
| @@ -183,7 +183,6 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueue) {
|
| Tile* tile = queue->Top();
|
| EXPECT_TRUE(tile);
|
| EXPECT_EQ(TilePriority::NOW, tile->priority(ACTIVE_TREE).priority_bin);
|
| - EXPECT_EQ(TilePriority::NOW, tile->priority(PENDING_TREE).priority_bin);
|
| if (tile->priority(ACTIVE_TREE).resolution == LOW_RESOLUTION)
|
| had_low_res = true;
|
| else
|
| @@ -433,19 +432,19 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueueInvalidation) {
|
| // Use a tile's content rect as an invalidation. We should inset it a bit to
|
| // ensure that border math doesn't invalidate neighbouring tiles.
|
| gfx::Rect invalidation =
|
| - pending_layer_->HighResTiling()->TileAt(1, 0)->content_rect();
|
| + active_layer_->HighResTiling()->TileAt(1, 0)->content_rect();
|
| invalidation.Inset(2, 2);
|
|
|
| pending_layer_->set_invalidation(invalidation);
|
| pending_layer_->HighResTiling()->Invalidate(invalidation);
|
| + pending_layer_->HighResTiling()->CreateMissingTilesInLiveTilesRect();
|
| pending_layer_->LowResTiling()->Invalidate(invalidation);
|
| + pending_layer_->LowResTiling()->CreateMissingTilesInLiveTilesRect();
|
|
|
| - // Sanity checks: Tile at 0, 0 should be the same on both trees, tile at 1, 0
|
| - // should be different.
|
| - EXPECT_TRUE(pending_layer_->HighResTiling()->TileAt(0, 0));
|
| + // Sanity checks: Tile at 0, 0 not exist on the pending tree (it's not
|
| + // invalidated). Tile 1, 0 should exist on both.
|
| + EXPECT_FALSE(pending_layer_->HighResTiling()->TileAt(0, 0));
|
| EXPECT_TRUE(active_layer_->HighResTiling()->TileAt(0, 0));
|
| - EXPECT_EQ(pending_layer_->HighResTiling()->TileAt(0, 0),
|
| - active_layer_->HighResTiling()->TileAt(0, 0));
|
| EXPECT_TRUE(pending_layer_->HighResTiling()->TileAt(1, 0));
|
| EXPECT_TRUE(active_layer_->HighResTiling()->TileAt(1, 0));
|
| EXPECT_NE(pending_layer_->HighResTiling()->TileAt(1, 0),
|
| @@ -456,13 +455,20 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueueInvalidation) {
|
| std::set<Tile*> expected_required_for_activation_tiles;
|
| for (int i = 0; i <= 1; ++i) {
|
| for (int j = 0; j <= 1; ++j) {
|
| - expected_now_tiles.insert(pending_layer_->HighResTiling()->TileAt(i, j));
|
| - expected_now_tiles.insert(active_layer_->HighResTiling()->TileAt(i, j));
|
| -
|
| - expected_required_for_activation_tiles.insert(
|
| - pending_layer_->HighResTiling()->TileAt(i, j));
|
| - expected_required_for_draw_tiles.insert(
|
| - active_layer_->HighResTiling()->TileAt(i, j));
|
| + bool have_pending_tile = false;
|
| + if (pending_layer_->HighResTiling()->TileAt(i, j)) {
|
| + expected_now_tiles.insert(
|
| + pending_layer_->HighResTiling()->TileAt(i, j));
|
| + expected_required_for_activation_tiles.insert(
|
| + pending_layer_->HighResTiling()->TileAt(i, j));
|
| + have_pending_tile = true;
|
| + }
|
| + Tile* active_tile = active_layer_->HighResTiling()->TileAt(i, j);
|
| + EXPECT_TRUE(active_tile);
|
| + expected_now_tiles.insert(active_tile);
|
| + expected_required_for_draw_tiles.insert(active_tile);
|
| + if (!have_pending_tile)
|
| + expected_required_for_activation_tiles.insert(active_tile);
|
| }
|
| }
|
| // Expect 3 shared tiles and 1 unshared tile in total.
|
| @@ -476,7 +482,10 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterTilePriorityQueueInvalidation) {
|
| std::set<Tile*> expected_all_tiles;
|
| for (int i = 0; i <= 3; ++i) {
|
| for (int j = 0; j <= 3; ++j) {
|
| - expected_all_tiles.insert(pending_layer_->HighResTiling()->TileAt(i, j));
|
| + if (pending_layer_->HighResTiling()->TileAt(i, j))
|
| + expected_all_tiles.insert(
|
| + pending_layer_->HighResTiling()->TileAt(i, j));
|
| + EXPECT_TRUE(active_layer_->HighResTiling()->TileAt(i, j));
|
| expected_all_tiles.insert(active_layer_->HighResTiling()->TileAt(i, j));
|
| }
|
| }
|
| @@ -611,7 +620,6 @@ TEST_F(TileManagerTilePriorityQueueTest, EvictionTilePriorityQueue) {
|
| Tile* tile = queue->Top();
|
| EXPECT_TRUE(tile);
|
| EXPECT_EQ(TilePriority::NOW, tile->priority(ACTIVE_TREE).priority_bin);
|
| - EXPECT_EQ(TilePriority::NOW, tile->priority(PENDING_TREE).priority_bin);
|
| EXPECT_TRUE(tile->HasResource());
|
| smoothness_tiles.insert(tile);
|
| queue->Pop();
|
|
|