| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 TileTaskManager* tile_task_manager, | 121 TileTaskManager* tile_task_manager, |
| 122 RasterBufferProvider* raster_buffer_provider, | 122 RasterBufferProvider* raster_buffer_provider, |
| 123 size_t scheduled_raster_task_limit, | 123 size_t scheduled_raster_task_limit, |
| 124 bool use_gpu_rasterization); | 124 bool use_gpu_rasterization); |
| 125 | 125 |
| 126 // This causes any completed raster work to finalize, so that tiles get up to | 126 // This causes any completed raster work to finalize, so that tiles get up to |
| 127 // date draw information. | 127 // date draw information. |
| 128 void Flush(); | 128 void Flush(); |
| 129 | 129 |
| 130 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, | 130 ScopedTilePtr CreateTile(const Tile::CreateInfo& info, |
| 131 const gfx::ColorSpace& color_space, |
| 131 int layer_id, | 132 int layer_id, |
| 132 int source_frame_number, | 133 int source_frame_number, |
| 133 int flags); | 134 int flags); |
| 134 | 135 |
| 135 bool IsReadyToActivate() const; | 136 bool IsReadyToActivate() const; |
| 136 bool IsReadyToDraw() const; | 137 bool IsReadyToDraw() const; |
| 137 | 138 |
| 138 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 139 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 139 BasicStateAsValue() const; | 140 BasicStateAsValue() const; |
| 140 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; | 141 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; |
| 141 const MemoryHistory::Entry& memory_stats_from_last_assign() const { | 142 const MemoryHistory::Entry& memory_stats_from_last_assign() const { |
| 142 return memory_stats_from_last_assign_; | 143 return memory_stats_from_last_assign_; |
| 143 } | 144 } |
| 144 | 145 |
| 145 // Public methods for testing. | 146 // Public methods for testing. |
| 146 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 147 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 147 for (size_t i = 0; i < tiles.size(); ++i) { | 148 for (size_t i = 0; i < tiles.size(); ++i) { |
| 148 TileDrawInfo& draw_info = tiles[i]->draw_info(); | 149 TileDrawInfo& draw_info = tiles[i]->draw_info(); |
| 149 draw_info.resource_ = resource_pool_->AcquireResource( | 150 draw_info.resource_ = resource_pool_->AcquireResource( |
| 150 tiles[i]->desired_texture_size(), | 151 tiles[i]->desired_texture_size(), |
| 151 raster_buffer_provider_->GetResourceFormat(false), gfx::ColorSpace()); | 152 raster_buffer_provider_->GetResourceFormat(false), |
| 153 tiles[i]->color_space()); |
| 152 } | 154 } |
| 153 } | 155 } |
| 154 | 156 |
| 155 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { | 157 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 156 for (size_t i = 0; i < tiles.size(); ++i) { | 158 for (size_t i = 0; i < tiles.size(); ++i) { |
| 157 Tile* tile = tiles[i]; | 159 Tile* tile = tiles[i]; |
| 158 FreeResourcesForTile(tile); | 160 FreeResourcesForTile(tile); |
| 159 } | 161 } |
| 160 } | 162 } |
| 161 | 163 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 std::vector<std::pair<DrawImage, scoped_refptr<TileTask>>> locked_images_; | 342 std::vector<std::pair<DrawImage, scoped_refptr<TileTask>>> locked_images_; |
| 341 | 343 |
| 342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 344 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
| 343 | 345 |
| 344 DISALLOW_COPY_AND_ASSIGN(TileManager); | 346 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 345 }; | 347 }; |
| 346 | 348 |
| 347 } // namespace cc | 349 } // namespace cc |
| 348 | 350 |
| 349 #endif // CC_TILES_TILE_MANAGER_H_ | 351 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |