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

Unified Diff: cc/tiles/tile_manager.cc

Issue 2822493003: cc: Create raster tasks in AssignGpuMemoryToTiles. (Closed)
Patch Set: disabled-by-default Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager.cc
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc
index 5639661f71378017debf09285579ffb84f6a6a84..d99ceaca9a3106589bb126277f58fc16ad3fd7d5 100644
--- a/cc/tiles/tile_manager.cc
+++ b/cc/tiles/tile_manager.cc
@@ -639,6 +639,8 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
MemoryUsage memory_usage(resource_pool_->memory_usage_bytes(),
resource_pool_->resource_count());
+ gfx::ColorSpace raster_color_space = client_->GetRasterColorSpace();
+
std::unique_ptr<RasterTilePriorityQueue> raster_priority_queue(
client_->BuildRasterQueue(global_state_.tree_priority,
RasterTilePriorityQueue::Type::ALL));
@@ -729,6 +731,13 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
break;
}
+ // If we were able to assign memory to this tile, create a raster task if
+ // necessary.
+ if (!tile->raster_task_) {
+ tile->raster_task_ =
+ CreateRasterTask(prioritized_tile, raster_color_space);
+ }
+
memory_usage += memory_required_by_tile_to_be_scheduled;
work_to_schedule.tiles_to_raster.push_back(prioritized_tile);
}
@@ -823,11 +832,7 @@ void TileManager::ScheduleTasks(
DCHECK(tile->draw_info().requires_resource());
DCHECK(!tile->draw_info().resource());
-
- if (!tile->raster_task_) {
- tile->raster_task_ =
- CreateRasterTask(prioritized_tile, raster_color_space);
- }
+ DCHECK(tile->HasRasterTask());
TileTask* task = tile->raster_task_.get();
@@ -938,6 +943,9 @@ void TileManager::ScheduleTasks(
scoped_refptr<TileTask> TileManager::CreateRasterTask(
const PrioritizedTile& prioritized_tile,
const gfx::ColorSpace& color_space) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
+ "TileManager::CreateRasterTask");
+
Tile* tile = prioritized_tile.tile();
// Get the resource.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698