| 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/eviction_tile_priority_queue.h" | 5 #include "cc/resources/eviction_tile_priority_queue.h" |
| 6 #include "cc/resources/raster_tile_priority_queue.h" | 6 #include "cc/resources/raster_tile_priority_queue.h" |
| 7 #include "cc/resources/tile.h" | 7 #include "cc/resources/tile.h" |
| 8 #include "cc/resources/tile_priority.h" | 8 #include "cc/resources/tile_priority.h" |
| 9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 TileVector CreateTiles(int count, | 120 TileVector CreateTiles(int count, |
| 121 TilePriority active_priority, | 121 TilePriority active_priority, |
| 122 TilePriority pending_priority) { | 122 TilePriority pending_priority) { |
| 123 return CreateTilesWithSize( | 123 return CreateTilesWithSize( |
| 124 count, active_priority, pending_priority, settings_.default_tile_size); | 124 count, active_priority, pending_priority, settings_.default_tile_size); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void ReleaseTiles(TileVector* tiles) { | 127 void ReleaseTiles(TileVector* tiles) { |
| 128 for (TileVector::iterator it = tiles->begin(); it != tiles->end(); it++) { | 128 for (TileVector::iterator it = tiles->begin(); it != tiles->end(); it++) { |
| 129 Tile* tile = *it; | 129 Tile* tile = it->get(); |
| 130 tile->SetPriority(ACTIVE_TREE, TilePriority()); | 130 tile->SetPriority(ACTIVE_TREE, TilePriority()); |
| 131 tile->SetPriority(PENDING_TREE, TilePriority()); | 131 tile->SetPriority(PENDING_TREE, TilePriority()); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 FakeTileManager* tile_manager() { return tile_manager_.get(); } | 135 FakeTileManager* tile_manager() { return tile_manager_.get(); } |
| 136 | 136 |
| 137 int AssignedMemoryCount(const TileVector& tiles) { | 137 int AssignedMemoryCount(const TileVector& tiles) { |
| 138 int has_memory_count = 0; | 138 int has_memory_count = 0; |
| 139 for (TileVector::const_iterator it = tiles.begin(); it != tiles.end(); | 139 for (TileVector::const_iterator it = tiles.begin(); it != tiles.end(); |
| 140 ++it) { | 140 ++it) { |
| 141 if (tile_manager_->HasBeenAssignedMemory(*it)) | 141 if (tile_manager_->HasBeenAssignedMemory(it->get())) |
| 142 ++has_memory_count; | 142 ++has_memory_count; |
| 143 } | 143 } |
| 144 return has_memory_count; | 144 return has_memory_count; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool ready_to_activate() const { return ready_to_activate_; } | 147 bool ready_to_activate() const { return ready_to_activate_; } |
| 148 | 148 |
| 149 // The parametrization specifies whether the max tile limit should | 149 // The parametrization specifies whether the max tile limit should |
| 150 // be applied to memory or resources. | 150 // be applied to memory or resources. |
| 151 bool UsingResourceLimit() { return !GetParam(); } | 151 bool UsingResourceLimit() { return !GetParam(); } |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 all_tiles.insert(queue.Top()); | 1209 all_tiles.insert(queue.Top()); |
| 1210 ++tile_count; | 1210 ++tile_count; |
| 1211 queue.Pop(); | 1211 queue.Pop(); |
| 1212 } | 1212 } |
| 1213 EXPECT_EQ(tile_count, all_tiles.size()); | 1213 EXPECT_EQ(tile_count, all_tiles.size()); |
| 1214 EXPECT_EQ(17u, tile_count); | 1214 EXPECT_EQ(17u, tile_count); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 } // namespace | 1217 } // namespace |
| 1218 } // namespace cc | 1218 } // namespace cc |
| OLD | NEW |