| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Note if the queue was previous built, Reset must be called on it. | 72 // Note if the queue was previous built, Reset must be called on it. |
| 73 virtual std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( | 73 virtual std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( |
| 74 TreePriority tree_priority) = 0; | 74 TreePriority tree_priority) = 0; |
| 75 | 75 |
| 76 // Informs the client that due to the currently rasterizing (or scheduled to | 76 // Informs the client that due to the currently rasterizing (or scheduled to |
| 77 // be rasterized) tiles, we will be in a position that will likely require a | 77 // be rasterized) tiles, we will be in a position that will likely require a |
| 78 // draw. This can be used to preemptively start a frame. | 78 // draw. This can be used to preemptively start a frame. |
| 79 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0; | 79 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0; |
| 80 | 80 |
| 81 // Requests the color space into which tiles should be rasterized. | 81 // Requests the color space into which tiles should be rasterized. |
| 82 virtual gfx::ColorSpace GetTileColorSpace() const = 0; | 82 virtual gfx::ColorSpace GetRasterColorSpace() const = 0; |
| 83 | 83 |
| 84 // Requests that a pending tree be scheduled to invalidate content on the | 84 // Requests that a pending tree be scheduled to invalidate content on the |
| 85 // pending on active tree. This is currently used when tiles that are | 85 // pending on active tree. This is currently used when tiles that are |
| 86 // rasterized with missing images need to be invalidated. | 86 // rasterized with missing images need to be invalidated. |
| 87 virtual void RequestImplSideInvalidation() = 0; | 87 virtual void RequestImplSideInvalidation() = 0; |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 virtual ~TileManagerClient() {} | 90 virtual ~TileManagerClient() {} |
| 91 }; | 91 }; |
| 92 | 92 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return memory_stats_from_last_assign_; | 160 return memory_stats_from_last_assign_; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Public methods for testing. | 163 // Public methods for testing. |
| 164 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { | 164 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 165 for (size_t i = 0; i < tiles.size(); ++i) { | 165 for (size_t i = 0; i < tiles.size(); ++i) { |
| 166 TileDrawInfo& draw_info = tiles[i]->draw_info(); | 166 TileDrawInfo& draw_info = tiles[i]->draw_info(); |
| 167 draw_info.set_resource(resource_pool_->AcquireResource( | 167 draw_info.set_resource(resource_pool_->AcquireResource( |
| 168 tiles[i]->desired_texture_size(), | 168 tiles[i]->desired_texture_size(), |
| 169 raster_buffer_provider_->GetResourceFormat(false), | 169 raster_buffer_provider_->GetResourceFormat(false), |
| 170 client_->GetTileColorSpace())); | 170 client_->GetRasterColorSpace())); |
| 171 draw_info.set_resource_ready_for_draw(); | 171 draw_info.set_resource_ready_for_draw(); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { | 175 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { |
| 176 for (size_t i = 0; i < tiles.size(); ++i) { | 176 for (size_t i = 0; i < tiles.size(); ++i) { |
| 177 Tile* tile = tiles[i]; | 177 Tile* tile = tiles[i]; |
| 178 FreeResourcesForTile(tile); | 178 FreeResourcesForTile(tile); |
| 179 } | 179 } |
| 180 } | 180 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; | 375 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; |
| 376 // The |ready_to_draw_callback_weak_ptr_factory_| is never invalidated. | 376 // The |ready_to_draw_callback_weak_ptr_factory_| is never invalidated. |
| 377 base::WeakPtrFactory<TileManager> ready_to_draw_callback_weak_ptr_factory_; | 377 base::WeakPtrFactory<TileManager> ready_to_draw_callback_weak_ptr_factory_; |
| 378 | 378 |
| 379 DISALLOW_COPY_AND_ASSIGN(TileManager); | 379 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 } // namespace cc | 382 } // namespace cc |
| 383 | 383 |
| 384 #endif // CC_TILES_TILE_MANAGER_H_ | 384 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |