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

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

Issue 733773005: cc: GPU rasterize tiles synchronously in PrepareToDraw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant completed_tasks_.clear() Created 6 years, 1 month 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
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_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>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 static scoped_ptr<TileManager> Create( 100 static scoped_ptr<TileManager> Create(
101 TileManagerClient* client, 101 TileManagerClient* client,
102 base::SequencedTaskRunner* task_runner, 102 base::SequencedTaskRunner* task_runner,
103 ResourcePool* resource_pool, 103 ResourcePool* resource_pool,
104 Rasterizer* rasterizer, 104 Rasterizer* rasterizer,
105 RenderingStatsInstrumentation* rendering_stats_instrumentation, 105 RenderingStatsInstrumentation* rendering_stats_instrumentation,
106 size_t scheduled_raster_task_limit); 106 size_t scheduled_raster_task_limit);
107 ~TileManager() override; 107 ~TileManager() override;
108 108
109 void RasterizeTiles(const GlobalStateThatImpactsTilePriority& state);
109 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); 110 void ManageTiles(const GlobalStateThatImpactsTilePriority& state);
110 111
111 void UpdateVisibleTiles(); 112 void UpdateVisibleTiles();
112 113
113 scoped_refptr<Tile> CreateTile(RasterSource* raster_source, 114 scoped_refptr<Tile> CreateTile(RasterSource* raster_source,
114 const gfx::Size& tile_size, 115 const gfx::Size& tile_size,
115 const gfx::Rect& content_rect, 116 const gfx::Rect& content_rect,
116 float contents_scale, 117 float contents_scale,
117 int layer_id, 118 int layer_id,
118 int source_frame_number, 119 int source_frame_number,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void DidFinishRunningTasks(TaskSet task_set) override; 182 void DidFinishRunningTasks(TaskSet task_set) override;
182 TaskSetCollection TasksThatShouldBeForcedToComplete() const override; 183 TaskSetCollection TasksThatShouldBeForcedToComplete() const override;
183 184
184 typedef std::vector<Tile*> TileVector; 185 typedef std::vector<Tile*> TileVector;
185 typedef std::set<Tile*> TileSet; 186 typedef std::set<Tile*> TileSet;
186 187
187 // Virtual for test 188 // Virtual for test
188 virtual void ScheduleTasks( 189 virtual void ScheduleTasks(
189 const TileVector& tiles_that_need_to_be_rasterized); 190 const TileVector& tiles_that_need_to_be_rasterized);
190 191
191 void AssignGpuMemoryToTiles(TileVector* tiles_that_need_to_be_rasterized); 192 void AssignGpuMemoryToTiles(TileVector* tiles_that_need_to_be_rasterized,
193 size_t scheduled_raser_task_limit);
192 194
193 private: 195 private:
194 class MemoryUsage { 196 class MemoryUsage {
195 public: 197 public:
196 MemoryUsage(); 198 MemoryUsage();
197 MemoryUsage(int64 memory_bytes, int resource_count); 199 MemoryUsage(int64 memory_bytes, int resource_count);
198 200
199 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format); 201 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format);
200 static MemoryUsage FromTile(const Tile* tile); 202 static MemoryUsage FromTile(const Tile* tile);
201 203
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 RasterTilePriorityQueue raster_priority_queue_; 283 RasterTilePriorityQueue raster_priority_queue_;
282 EvictionTilePriorityQueue eviction_priority_queue_; 284 EvictionTilePriorityQueue eviction_priority_queue_;
283 bool eviction_priority_queue_is_up_to_date_; 285 bool eviction_priority_queue_is_up_to_date_;
284 286
285 DISALLOW_COPY_AND_ASSIGN(TileManager); 287 DISALLOW_COPY_AND_ASSIGN(TileManager);
286 }; 288 };
287 289
288 } // namespace cc 290 } // namespace cc
289 291
290 #endif // CC_RESOURCES_TILE_MANAGER_H_ 292 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698