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_TILES_TILE_MANAGER_H_ | 5 #ifndef CC_TILES_TILE_MANAGER_H_ |
6 #define CC_TILES_TILE_MANAGER_H_ | 6 #define CC_TILES_TILE_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Synchronously finish any in progress work, cancel the rest, and clean up as | 121 // Synchronously finish any in progress work, cancel the rest, and clean up as |
122 // much resources as possible. Also, prevents any future work until a | 122 // much resources as possible. Also, prevents any future work until a |
123 // SetResources call. | 123 // SetResources call. |
124 void FinishTasksAndCleanUp(); | 124 void FinishTasksAndCleanUp(); |
125 | 125 |
126 // Set the new given resource pool and tile task runner. Note that | 126 // Set the new given resource pool and tile task runner. Note that |
127 // FinishTasksAndCleanUp must be called in between consecutive calls to | 127 // FinishTasksAndCleanUp must be called in between consecutive calls to |
128 // SetResources. | 128 // SetResources. |
129 void SetResources(ResourcePool* resource_pool, | 129 void SetResources(ResourcePool* resource_pool, |
130 TileTaskRunner* tile_task_runner, | 130 TileTaskRunner* tile_task_runner, |
131 size_t scheduled_raster_task_limit); | 131 size_t scheduled_raster_task_limit, |
| 132 bool is_using_gpu_rasterization); |
132 | 133 |
133 // This causes any completed raster work to finalize, so that tiles get up to | 134 // This causes any completed raster work to finalize, so that tiles get up to |
134 // date draw information. | 135 // date draw information. |
135 void Flush(); | 136 void Flush(); |
136 | 137 |
137 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, | 138 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, |
138 int layer_id, | 139 int layer_id, |
139 int source_frame_number, | 140 int source_frame_number, |
140 int flags); | 141 int flags); |
141 | 142 |
142 bool IsReadyToActivate() const; | 143 bool IsReadyToActivate() const; |
143 bool IsReadyToDraw() const; | 144 bool IsReadyToDraw() const; |
144 | 145 |
| 146 ImageDecodeController* GetImageDecodeController() { |
| 147 return &image_decode_controller_; |
| 148 } |
| 149 |
145 scoped_refptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue() | 150 scoped_refptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue() |
146 const; | 151 const; |
147 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; | 152 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; |
148 const MemoryHistory::Entry& memory_stats_from_last_assign() const { | 153 const MemoryHistory::Entry& memory_stats_from_last_assign() const { |
149 return memory_stats_from_last_assign_; | 154 return memory_stats_from_last_assign_; |
150 } | 155 } |
151 | 156 |
152 // Public methods for testing. | 157 // Public methods for testing. |
153 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 158 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
154 for (size_t i = 0; i < tiles.size(); ++i) { | 159 for (size_t i = 0; i < tiles.size(); ++i) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 bool did_notify_all_tile_tasks_completed; | 336 bool did_notify_all_tile_tasks_completed; |
332 } signals_; | 337 } signals_; |
333 | 338 |
334 UniqueNotifier signals_check_notifier_; | 339 UniqueNotifier signals_check_notifier_; |
335 | 340 |
336 bool has_scheduled_tile_tasks_; | 341 bool has_scheduled_tile_tasks_; |
337 | 342 |
338 uint64_t prepare_tiles_count_; | 343 uint64_t prepare_tiles_count_; |
339 uint64_t next_tile_id_; | 344 uint64_t next_tile_id_; |
340 | 345 |
| 346 base::hash_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; |
| 347 |
341 DISALLOW_COPY_AND_ASSIGN(TileManager); | 348 DISALLOW_COPY_AND_ASSIGN(TileManager); |
342 }; | 349 }; |
343 | 350 |
344 } // namespace cc | 351 } // namespace cc |
345 | 352 |
346 #endif // CC_TILES_TILE_MANAGER_H_ | 353 #endif // CC_TILES_TILE_MANAGER_H_ |
OLD | NEW |