| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_RESOURCES_TILE_MANAGER_H_ | 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_ |
| 6 #define CC_RESOURCES_TILE_MANAGER_H_ | 6 #define CC_RESOURCES_TILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "cc/base/ref_counted_managed.h" | 17 #include "cc/base/ref_counted_managed.h" |
| 18 #include "cc/base/unique_notifier.h" | 18 #include "cc/base/unique_notifier.h" |
| 19 #include "cc/resources/eviction_tile_priority_queue.h" | 19 #include "cc/resources/eviction_tile_priority_queue.h" |
| 20 #include "cc/resources/managed_tile_state.h" | |
| 21 #include "cc/resources/memory_history.h" | 20 #include "cc/resources/memory_history.h" |
| 22 #include "cc/resources/raster_source.h" | 21 #include "cc/resources/raster_source.h" |
| 23 #include "cc/resources/raster_tile_priority_queue.h" | 22 #include "cc/resources/raster_tile_priority_queue.h" |
| 24 #include "cc/resources/resource_pool.h" | 23 #include "cc/resources/resource_pool.h" |
| 25 #include "cc/resources/tile.h" | 24 #include "cc/resources/tile.h" |
| 25 #include "cc/resources/tile_draw_info.h" |
| 26 #include "cc/resources/tile_task_runner.h" | 26 #include "cc/resources/tile_task_runner.h" |
| 27 | 27 |
| 28 namespace base { | 28 namespace base { |
| 29 namespace debug { | 29 namespace debug { |
| 30 class ConvertableToTraceFormat; | 30 class ConvertableToTraceFormat; |
| 31 class TracedValue; | 31 class TracedValue; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace cc { | 35 namespace cc { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue() | 124 scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue() |
| 125 const; | 125 const; |
| 126 void BasicStateAsValueInto(base::debug::TracedValue* dict) const; | 126 void BasicStateAsValueInto(base::debug::TracedValue* dict) const; |
| 127 const MemoryHistory::Entry& memory_stats_from_last_assign() const { | 127 const MemoryHistory::Entry& memory_stats_from_last_assign() const { |
| 128 return memory_stats_from_last_assign_; | 128 return memory_stats_from_last_assign_; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 131 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 132 for (size_t i = 0; i < tiles.size(); ++i) { | 132 for (size_t i = 0; i < tiles.size(); ++i) { |
| 133 ManagedTileState& mts = tiles[i]->managed_state(); | 133 TileDrawInfo& draw_info = tiles[i]->draw_info(); |
| 134 | 134 draw_info.resource_ = resource_pool_->AcquireResource(tiles[i]->size()); |
| 135 mts.draw_info.resource_ = | |
| 136 resource_pool_->AcquireResource(tiles[i]->size()); | |
| 137 } | 135 } |
| 138 } | 136 } |
| 139 | 137 |
| 140 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { | 138 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 141 for (size_t i = 0; i < tiles.size(); ++i) { | 139 for (size_t i = 0; i < tiles.size(); ++i) { |
| 142 Tile* tile = tiles[i]; | 140 Tile* tile = tiles[i]; |
| 143 FreeResourcesForTile(tile); | 141 FreeResourcesForTile(tile); |
| 144 } | 142 } |
| 145 } | 143 } |
| 146 | 144 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 286 |
| 289 bool did_notify_ready_to_activate_; | 287 bool did_notify_ready_to_activate_; |
| 290 bool did_notify_ready_to_draw_; | 288 bool did_notify_ready_to_draw_; |
| 291 | 289 |
| 292 DISALLOW_COPY_AND_ASSIGN(TileManager); | 290 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 293 }; | 291 }; |
| 294 | 292 |
| 295 } // namespace cc | 293 } // namespace cc |
| 296 | 294 |
| 297 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 295 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
| OLD | NEW |