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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 virtual void TearDown() OVERRIDE { | 78 virtual void TearDown() OVERRIDE { |
79 tile_manager_.reset(NULL); | 79 tile_manager_.reset(NULL); |
80 picture_pile_ = NULL; | 80 picture_pile_ = NULL; |
81 | 81 |
82 testing::Test::TearDown(); | 82 testing::Test::TearDown(); |
83 } | 83 } |
84 | 84 |
85 // TileManagerClient implementation. | 85 // TileManagerClient implementation. |
86 virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; } | 86 virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; } |
| 87 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE {} |
87 | 88 |
88 TileVector CreateTilesWithSize(int count, | 89 TileVector CreateTilesWithSize(int count, |
89 TilePriority active_priority, | 90 TilePriority active_priority, |
90 TilePriority pending_priority, | 91 TilePriority pending_priority, |
91 const gfx::Size& tile_size) { | 92 const gfx::Size& tile_size) { |
92 TileVector tiles; | 93 TileVector tiles; |
93 for (int i = 0; i < count; ++i) { | 94 for (int i = 0; i < count; ++i) { |
94 scoped_refptr<Tile> tile = tile_manager_->CreateTile(picture_pile_.get(), | 95 scoped_refptr<Tile> tile = tile_manager_->CreateTile(picture_pile_.get(), |
95 tile_size, | 96 tile_size, |
96 gfx::Rect(), | 97 gfx::Rect(), |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 void CreateHighLowResAndSetAllTilesVisible() { | 733 void CreateHighLowResAndSetAllTilesVisible() { |
733 // Active layer must get updated first so pending layer can share from it. | 734 // Active layer must get updated first so pending layer can share from it. |
734 active_layer_->CreateDefaultTilingsAndTiles(); | 735 active_layer_->CreateDefaultTilingsAndTiles(); |
735 active_layer_->SetAllTilesVisible(); | 736 active_layer_->SetAllTilesVisible(); |
736 pending_layer_->CreateDefaultTilingsAndTiles(); | 737 pending_layer_->CreateDefaultTilingsAndTiles(); |
737 pending_layer_->SetAllTilesVisible(); | 738 pending_layer_->SetAllTilesVisible(); |
738 } | 739 } |
739 | 740 |
740 // TileManagerClient implementation. | 741 // TileManagerClient implementation. |
741 virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; } | 742 virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; } |
| 743 virtual void NotifyTileInitialized(const Tile* tile) OVERRIDE {} |
742 | 744 |
743 TileManager* tile_manager() { return host_impl_.tile_manager(); } | 745 TileManager* tile_manager() { return host_impl_.tile_manager(); } |
744 | 746 |
745 protected: | 747 protected: |
746 GlobalStateThatImpactsTilePriority global_state_; | 748 GlobalStateThatImpactsTilePriority global_state_; |
747 | 749 |
748 TestSharedBitmapManager shared_bitmap_manager_; | 750 TestSharedBitmapManager shared_bitmap_manager_; |
749 TileMemoryLimitPolicy memory_limit_policy_; | 751 TileMemoryLimitPolicy memory_limit_policy_; |
750 int max_tiles_; | 752 int max_tiles_; |
751 bool ready_to_activate_; | 753 bool ready_to_activate_; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 | 1136 |
1135 last_tile = tile; | 1137 last_tile = tile; |
1136 new_content_tiles.insert(tile); | 1138 new_content_tiles.insert(tile); |
1137 } | 1139 } |
1138 | 1140 |
1139 EXPECT_EQ(tile_count, new_content_tiles.size()); | 1141 EXPECT_EQ(tile_count, new_content_tiles.size()); |
1140 EXPECT_EQ(all_tiles, new_content_tiles); | 1142 EXPECT_EQ(all_tiles, new_content_tiles); |
1141 } | 1143 } |
1142 } // namespace | 1144 } // namespace |
1143 } // namespace cc | 1145 } // namespace cc |
OLD | NEW |