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

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

Issue 2440093003: WIP GPU scheduler + delayed activation / tile draw
Patch Set: SignalSyncToken -> IsFenceSyncReleased Created 4 years 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/tiles/tile_draw_info.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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 struct PrioritizedWorkToSchedule { 256 struct PrioritizedWorkToSchedule {
257 PrioritizedWorkToSchedule(); 257 PrioritizedWorkToSchedule();
258 PrioritizedWorkToSchedule(PrioritizedWorkToSchedule&& other); 258 PrioritizedWorkToSchedule(PrioritizedWorkToSchedule&& other);
259 ~PrioritizedWorkToSchedule(); 259 ~PrioritizedWorkToSchedule();
260 260
261 std::vector<PrioritizedTile> tiles_to_raster; 261 std::vector<PrioritizedTile> tiles_to_raster;
262 std::vector<PrioritizedTile> tiles_to_process_for_images; 262 std::vector<PrioritizedTile> tiles_to_process_for_images;
263 }; 263 };
264 264
265 void AcquireResourcesForTile(Tile* tile);
265 void FreeResourcesForTile(Tile* tile); 266 void FreeResourcesForTile(Tile* tile);
266 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); 267 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
267 scoped_refptr<TileTask> CreateRasterTask( 268 scoped_refptr<TileTask> CreateRasterTask(
268 const PrioritizedTile& prioritized_tile, 269 const PrioritizedTile& prioritized_tile,
269 const gfx::ColorSpace& color_space); 270 const gfx::ColorSpace& color_space);
270 271
271 std::unique_ptr<EvictionTilePriorityQueue> 272 std::unique_ptr<EvictionTilePriorityQueue>
272 FreeTileResourcesUntilUsageIsWithinLimit( 273 FreeTileResourcesUntilUsageIsWithinLimit(
273 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, 274 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue,
274 const MemoryUsage& limit, 275 const MemoryUsage& limit,
(...skipping 11 matching lines...) Expand all
286 bool MarkTilesOutOfMemory( 287 bool MarkTilesOutOfMemory(
287 std::unique_ptr<RasterTilePriorityQueue> queue) const; 288 std::unique_ptr<RasterTilePriorityQueue> queue) const;
288 289
289 ResourceFormat DetermineResourceFormat(const Tile* tile) const; 290 ResourceFormat DetermineResourceFormat(const Tile* tile) const;
290 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; 291 bool DetermineResourceRequiresSwizzle(const Tile* tile) const;
291 292
292 void DidFinishRunningTileTasksRequiredForActivation(); 293 void DidFinishRunningTileTasksRequiredForActivation();
293 void DidFinishRunningTileTasksRequiredForDraw(); 294 void DidFinishRunningTileTasksRequiredForDraw();
294 void DidFinishRunningAllTileTasks(); 295 void DidFinishRunningAllTileTasks();
295 296
297 void OnRequiredForActivationTilesReadyToDraw();
298 void OnRequiredForDrawTilesReadyToDraw();
299
300 void CheckRequiredForActivationTilesReadyToDraw();
301 void CheckRequiredForDrawTilesReadyToDraw();
302
303 void OnTileReadyToDraw(Tile* tile);
304
296 scoped_refptr<TileTask> CreateTaskSetFinishedTask( 305 scoped_refptr<TileTask> CreateTaskSetFinishedTask(
297 void (TileManager::*callback)()); 306 void (TileManager::*callback)());
298 PrioritizedWorkToSchedule AssignGpuMemoryToTiles(); 307 PrioritizedWorkToSchedule AssignGpuMemoryToTiles();
299 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule); 308 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule);
300 309
301 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> 310 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
302 ScheduledTasksStateAsValue() const; 311 ScheduledTasksStateAsValue() const;
303 312
304 bool UsePartialRaster() const; 313 bool UsePartialRaster() const;
305 314
(...skipping 16 matching lines...) Expand all
322 bool did_oom_on_last_assign_; 331 bool did_oom_on_last_assign_;
323 332
324 ImageController image_controller_; 333 ImageController image_controller_;
325 334
326 RasterTaskCompletionStats flush_stats_; 335 RasterTaskCompletionStats flush_stats_;
327 336
328 std::vector<Tile*> released_tiles_; 337 std::vector<Tile*> released_tiles_;
329 338
330 TaskGraph graph_; 339 TaskGraph graph_;
331 340
341 std::vector<Tile*> pending_required_for_activation_tiles_;
342 std::vector<Tile*> pending_required_for_draw_tiles_;
343
332 UniqueNotifier more_tiles_need_prepare_check_notifier_; 344 UniqueNotifier more_tiles_need_prepare_check_notifier_;
333 345
334 Signals signals_; 346 Signals signals_;
335 347
336 UniqueNotifier signals_check_notifier_; 348 UniqueNotifier signals_check_notifier_;
337 349
338 bool has_scheduled_tile_tasks_; 350 bool has_scheduled_tile_tasks_;
339 351
340 uint64_t prepare_tiles_count_; 352 uint64_t prepare_tiles_count_;
341 uint64_t next_tile_id_; 353 uint64_t next_tile_id_;
342 354
343 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 355 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
344 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; 356 std::vector<scoped_refptr<TileTask>> locked_image_tasks_;
345 357
346 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 358 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
347 359
360 base::WeakPtrFactory<TileManager> weak_ptr_factory_;
361
348 DISALLOW_COPY_AND_ASSIGN(TileManager); 362 DISALLOW_COPY_AND_ASSIGN(TileManager);
349 }; 363 };
350 364
351 } // namespace cc 365 } // namespace cc
352 366
353 #endif // CC_TILES_TILE_MANAGER_H_ 367 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/tiles/tile_draw_info.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698