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

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

Issue 2017453004: cc: Send notification of tasks completion directly without scheduling. Base URL: https://chromium.googlesource.com/chromium/src.git@worker_origin_split_4
Patch Set: feedback Created 4 years, 6 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 | « no previous file | cc/tiles/tile_manager.cc » ('j') | cc/tiles/tile_manager.cc » ('J')
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 MemoryUsage* usage); 261 MemoryUsage* usage);
262 std::unique_ptr<EvictionTilePriorityQueue> 262 std::unique_ptr<EvictionTilePriorityQueue>
263 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit( 263 FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
264 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, 264 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue,
265 const MemoryUsage& limit, 265 const MemoryUsage& limit,
266 const TilePriority& oother_priority, 266 const TilePriority& oother_priority,
267 MemoryUsage* usage); 267 MemoryUsage* usage);
268 bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority); 268 bool TilePriorityViolatesMemoryPolicy(const TilePriority& priority);
269 bool AreRequiredTilesReadyToDraw(RasterTilePriorityQueue::Type type) const; 269 bool AreRequiredTilesReadyToDraw(RasterTilePriorityQueue::Type type) const;
270 void CheckIfMoreTilesNeedToBePrepared(); 270 void CheckIfMoreTilesNeedToBePrepared();
271 void CheckAndIssueSignals(); 271 void CheckAndNotifyReadyToActivate();
272 void CheckAndNotifyReadyToDraw();
273 void CheckAndNotifyAllTileTasksCompleted();
272 bool MarkTilesOutOfMemory( 274 bool MarkTilesOutOfMemory(
273 std::unique_ptr<RasterTilePriorityQueue> queue) const; 275 std::unique_ptr<RasterTilePriorityQueue> queue) const;
274 276
275 ResourceFormat DetermineResourceFormat(const Tile* tile) const; 277 ResourceFormat DetermineResourceFormat(const Tile* tile) const;
276 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; 278 bool DetermineResourceRequiresSwizzle(const Tile* tile) const;
277 279
278 void DidFinishRunningTileTasksRequiredForActivation(); 280 void DidFinishRunningTileTasksRequiredForActivation(
279 void DidFinishRunningTileTasksRequiredForDraw(); 281 uint64_t source_prepare_tiles_id);
280 void DidFinishRunningAllTileTasks(); 282 void DidFinishRunningTileTasksRequiredForDraw(
283 uint64_t source_prepare_tiles_id);
284 void DidFinishRunningAllTileTasks(uint64_t source_prepare_tiles_id);
281 285
282 scoped_refptr<TileTask> CreateTaskSetFinishedTask( 286 scoped_refptr<TileTask> CreateTaskSetFinishedTask(
283 void (TileManager::*callback)()); 287 void (TileManager::*callback)(uint64_t source_prepare_tiles_id));
284
285 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
286 ScheduledTasksStateAsValue() const;
287 288
288 TileManagerClient* client_; 289 TileManagerClient* client_;
289 scoped_refptr<base::SequencedTaskRunner> task_runner_; 290 scoped_refptr<base::SequencedTaskRunner> task_runner_;
290 ResourcePool* resource_pool_; 291 ResourcePool* resource_pool_;
291 TileTaskManager* tile_task_manager_; 292 TileTaskManager* tile_task_manager_;
292 GlobalStateThatImpactsTilePriority global_state_; 293 GlobalStateThatImpactsTilePriority global_state_;
293 size_t scheduled_raster_task_limit_; 294 size_t scheduled_raster_task_limit_;
294 const bool use_partial_raster_; 295 const bool use_partial_raster_;
295 bool use_gpu_rasterization_; 296 bool use_gpu_rasterization_;
296 297
(...skipping 12 matching lines...) Expand all
309 310
310 std::vector<Tile*> released_tiles_; 311 std::vector<Tile*> released_tiles_;
311 312
312 std::vector<scoped_refptr<TileTask>> orphan_tasks_; 313 std::vector<scoped_refptr<TileTask>> orphan_tasks_;
313 314
314 TaskGraph graph_; 315 TaskGraph graph_;
315 scoped_refptr<TileTask> required_for_activation_done_task_; 316 scoped_refptr<TileTask> required_for_activation_done_task_;
316 scoped_refptr<TileTask> required_for_draw_done_task_; 317 scoped_refptr<TileTask> required_for_draw_done_task_;
317 scoped_refptr<TileTask> all_done_task_; 318 scoped_refptr<TileTask> all_done_task_;
318 319
319 UniqueNotifier more_tiles_need_prepare_check_notifier_;
320
321 struct Signals {
322 Signals();
323
324 void reset();
325
326 bool ready_to_activate;
327 bool did_notify_ready_to_activate;
328 bool ready_to_draw;
329 bool did_notify_ready_to_draw;
330 bool all_tile_tasks_completed;
331 bool did_notify_all_tile_tasks_completed;
332 } signals_;
333
334 UniqueNotifier signals_check_notifier_;
335
336 bool has_scheduled_tile_tasks_; 320 bool has_scheduled_tile_tasks_;
337 321
338 uint64_t prepare_tiles_count_; 322 uint64_t prepare_tiles_count_;
339 uint64_t next_tile_id_; 323 uint64_t next_tile_id_;
340 324
341 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 325 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
342 326
343 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 327 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
344 328
345 DISALLOW_COPY_AND_ASSIGN(TileManager); 329 DISALLOW_COPY_AND_ASSIGN(TileManager);
346 }; 330 };
347 331
348 } // namespace cc 332 } // namespace cc
349 333
350 #endif // CC_TILES_TILE_MANAGER_H_ 334 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | cc/tiles/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698