Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: cc/tiles/tile_manager.h

Issue 2336853002: cc: Plumb device color space through to rasterization (Closed)
Patch Set: Remove damage Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/fake_tile_manager_client.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // queue that will return tiles in order in which they should be evicted. 69 // queue that will return tiles in order in which they should be evicted.
70 // Note if the queue was previous built, Reset must be called on it. 70 // Note if the queue was previous built, Reset must be called on it.
71 virtual std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue( 71 virtual std::unique_ptr<EvictionTilePriorityQueue> BuildEvictionQueue(
72 TreePriority tree_priority) = 0; 72 TreePriority tree_priority) = 0;
73 73
74 // Informs the client that due to the currently rasterizing (or scheduled to 74 // Informs the client that due to the currently rasterizing (or scheduled to
75 // be rasterized) tiles, we will be in a position that will likely require a 75 // be rasterized) tiles, we will be in a position that will likely require a
76 // draw. This can be used to preemptively start a frame. 76 // draw. This can be used to preemptively start a frame.
77 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0; 77 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0;
78 78
79 // Requests the color space into which tiles should be rasterized.
80 virtual gfx::ColorSpace GetTileColorSpace() const = 0;
81
79 protected: 82 protected:
80 virtual ~TileManagerClient() {} 83 virtual ~TileManagerClient() {}
81 }; 84 };
82 85
83 struct RasterTaskCompletionStats { 86 struct RasterTaskCompletionStats {
84 RasterTaskCompletionStats(); 87 RasterTaskCompletionStats();
85 88
86 size_t completed_count; 89 size_t completed_count;
87 size_t canceled_count; 90 size_t canceled_count;
88 }; 91 };
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 144 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
142 return memory_stats_from_last_assign_; 145 return memory_stats_from_last_assign_;
143 } 146 }
144 147
145 // Public methods for testing. 148 // Public methods for testing.
146 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { 149 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) {
147 for (size_t i = 0; i < tiles.size(); ++i) { 150 for (size_t i = 0; i < tiles.size(); ++i) {
148 TileDrawInfo& draw_info = tiles[i]->draw_info(); 151 TileDrawInfo& draw_info = tiles[i]->draw_info();
149 draw_info.resource_ = resource_pool_->AcquireResource( 152 draw_info.resource_ = resource_pool_->AcquireResource(
150 tiles[i]->desired_texture_size(), 153 tiles[i]->desired_texture_size(),
151 raster_buffer_provider_->GetResourceFormat(false), gfx::ColorSpace()); 154 raster_buffer_provider_->GetResourceFormat(false),
155 client_->GetTileColorSpace());
152 } 156 }
153 } 157 }
154 158
155 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { 159 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) {
156 for (size_t i = 0; i < tiles.size(); ++i) { 160 for (size_t i = 0; i < tiles.size(); ++i) {
157 Tile* tile = tiles[i]; 161 Tile* tile = tiles[i];
158 FreeResourcesForTile(tile); 162 FreeResourcesForTile(tile);
159 } 163 }
160 } 164 }
161 165
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 PrioritizedWorkToSchedule(PrioritizedWorkToSchedule&& other); 254 PrioritizedWorkToSchedule(PrioritizedWorkToSchedule&& other);
251 ~PrioritizedWorkToSchedule(); 255 ~PrioritizedWorkToSchedule();
252 256
253 std::vector<PrioritizedTile> tiles_to_raster; 257 std::vector<PrioritizedTile> tiles_to_raster;
254 std::vector<PrioritizedTile> tiles_to_process_for_images; 258 std::vector<PrioritizedTile> tiles_to_process_for_images;
255 }; 259 };
256 260
257 void FreeResourcesForTile(Tile* tile); 261 void FreeResourcesForTile(Tile* tile);
258 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); 262 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
259 scoped_refptr<TileTask> CreateRasterTask( 263 scoped_refptr<TileTask> CreateRasterTask(
260 const PrioritizedTile& prioritized_tile); 264 const PrioritizedTile& prioritized_tile,
265 const gfx::ColorSpace& color_space);
261 266
262 std::unique_ptr<EvictionTilePriorityQueue> 267 std::unique_ptr<EvictionTilePriorityQueue>
263 FreeTileResourcesUntilUsageIsWithinLimit( 268 FreeTileResourcesUntilUsageIsWithinLimit(
264 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, 269 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue,
265 const MemoryUsage& limit, 270 const MemoryUsage& limit,
266 MemoryUsage* usage); 271 MemoryUsage* usage);
267 std::unique_ptr<EvictionTilePriorityQueue> 272 std::unique_ptr<EvictionTilePriorityQueue>
268 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit( 273 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
269 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, 274 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue,
270 const MemoryUsage& limit, 275 const MemoryUsage& limit,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 std::vector<std::pair<DrawImage, scoped_refptr<TileTask>>> locked_images_; 345 std::vector<std::pair<DrawImage, scoped_refptr<TileTask>>> locked_images_;
341 346
342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 347 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
343 348
344 DISALLOW_COPY_AND_ASSIGN(TileManager); 349 DISALLOW_COPY_AND_ASSIGN(TileManager);
345 }; 350 };
346 351
347 } // namespace cc 352 } // namespace cc
348 353
349 #endif // CC_TILES_TILE_MANAGER_H_ 354 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/test/fake_tile_manager_client.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698