OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/resources/tile.h" | 5 #include "cc/resources/tile.h" |
6 #include "cc/resources/tile_priority.h" | 6 #include "cc/resources/tile_priority.h" |
7 #include "cc/test/fake_impl_proxy.h" | 7 #include "cc/test/fake_impl_proxy.h" |
8 #include "cc/test/fake_layer_tree_host_impl.h" | 8 #include "cc/test/fake_layer_tree_host_impl.h" |
9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
10 #include "cc/test/fake_output_surface_client.h" | 10 #include "cc/test/fake_output_surface_client.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 EXPECT_EQ(TilePriority::NOW, tile->priority(ACTIVE_TREE).priority_bin); | 622 EXPECT_EQ(TilePriority::NOW, tile->priority(ACTIVE_TREE).priority_bin); |
623 EXPECT_EQ(TilePriority::NOW, tile->priority(PENDING_TREE).priority_bin); | 623 EXPECT_EQ(TilePriority::NOW, tile->priority(PENDING_TREE).priority_bin); |
624 smoothness_tiles.insert(tile); | 624 smoothness_tiles.insert(tile); |
625 } | 625 } |
626 EXPECT_EQ(all_tiles, smoothness_tiles); | 626 EXPECT_EQ(all_tiles, smoothness_tiles); |
627 | 627 |
628 Region invalidation(gfx::Rect(0, 0, 500, 500)); | 628 Region invalidation(gfx::Rect(0, 0, 500, 500)); |
629 | 629 |
630 // Invalidate the pending tree. | 630 // Invalidate the pending tree. |
631 pending_layer_->set_invalidation(invalidation); | 631 pending_layer_->set_invalidation(invalidation); |
632 pending_layer_->HighResTiling()->Invalidate(invalidation); | 632 pending_layer_->HighResTiling()->UpdateTilesToCurrentPile( |
633 pending_layer_->LowResTiling()->Invalidate(invalidation); | 633 invalidation, gfx::Size(1000, 1000)); |
| 634 pending_layer_->LowResTiling()->UpdateTilesToCurrentPile( |
| 635 invalidation, gfx::Size(1000, 1000)); |
634 | 636 |
635 active_layer_->ResetAllTilesPriorities(); | 637 active_layer_->ResetAllTilesPriorities(); |
636 pending_layer_->ResetAllTilesPriorities(); | 638 pending_layer_->ResetAllTilesPriorities(); |
637 | 639 |
638 // Renew all of the tile priorities. | 640 // Renew all of the tile priorities. |
639 gfx::Rect viewport(50, 50, 100, 100); | 641 gfx::Rect viewport(50, 50, 100, 100); |
640 pending_layer_->HighResTiling()->UpdateTilePriorities( | 642 pending_layer_->HighResTiling()->UpdateTilePriorities( |
641 PENDING_TREE, | 643 PENDING_TREE, |
642 viewport, | 644 viewport, |
643 1.0f, | 645 1.0f, |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 } | 825 } |
824 EXPECT_EQ(all_tiles, smoothness_tiles); | 826 EXPECT_EQ(all_tiles, smoothness_tiles); |
825 | 827 |
826 tile_manager->ReleaseTileResourcesForTesting( | 828 tile_manager->ReleaseTileResourcesForTesting( |
827 std::vector<Tile*>(all_tiles.begin(), all_tiles.end())); | 829 std::vector<Tile*>(all_tiles.begin(), all_tiles.end())); |
828 | 830 |
829 Region invalidation(gfx::Rect(0, 0, 500, 500)); | 831 Region invalidation(gfx::Rect(0, 0, 500, 500)); |
830 | 832 |
831 // Invalidate the pending tree. | 833 // Invalidate the pending tree. |
832 pending_layer_->set_invalidation(invalidation); | 834 pending_layer_->set_invalidation(invalidation); |
833 pending_layer_->HighResTiling()->Invalidate(invalidation); | 835 pending_layer_->HighResTiling()->UpdateTilesToCurrentPile( |
834 pending_layer_->LowResTiling()->Invalidate(invalidation); | 836 invalidation, gfx::Size(1000, 1000)); |
| 837 pending_layer_->LowResTiling()->UpdateTilesToCurrentPile( |
| 838 invalidation, gfx::Size(1000, 1000)); |
835 | 839 |
836 active_layer_->ResetAllTilesPriorities(); | 840 active_layer_->ResetAllTilesPriorities(); |
837 pending_layer_->ResetAllTilesPriorities(); | 841 pending_layer_->ResetAllTilesPriorities(); |
838 | 842 |
839 // Renew all of the tile priorities. | 843 // Renew all of the tile priorities. |
840 gfx::Rect viewport(50, 50, 100, 100); | 844 gfx::Rect viewport(50, 50, 100, 100); |
841 pending_layer_->HighResTiling()->UpdateTilePriorities( | 845 pending_layer_->HighResTiling()->UpdateTilePriorities( |
842 PENDING_TREE, | 846 PENDING_TREE, |
843 viewport, | 847 viewport, |
844 1.0f, | 848 1.0f, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 | 954 |
951 last_tile = tile; | 955 last_tile = tile; |
952 new_content_tiles.insert(tile); | 956 new_content_tiles.insert(tile); |
953 } | 957 } |
954 | 958 |
955 EXPECT_EQ(tile_count, new_content_tiles.size()); | 959 EXPECT_EQ(tile_count, new_content_tiles.size()); |
956 EXPECT_EQ(all_tiles, new_content_tiles); | 960 EXPECT_EQ(all_tiles, new_content_tiles); |
957 } | 961 } |
958 } // namespace | 962 } // namespace |
959 } // namespace cc | 963 } // namespace cc |
OLD | NEW |