summaryrefslogtreecommitdiffstats
path: root/chromium/cc/tiles/tile_manager.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-16 11:45:35 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-17 08:59:23 +0000
commit552906b0f222c5d5dd11b9fd73829d510980461a (patch)
tree3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/cc/tiles/tile_manager.cc
parent1b05827804eaf047779b597718c03e7d38344261 (diff)
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/cc/tiles/tile_manager.cc')
-rw-r--r--chromium/cc/tiles/tile_manager.cc57
1 files changed, 42 insertions, 15 deletions
diff --git a/chromium/cc/tiles/tile_manager.cc b/chromium/cc/tiles/tile_manager.cc
index 3fd32784f08..14bded9068c 100644
--- a/chromium/cc/tiles/tile_manager.cc
+++ b/chromium/cc/tiles/tile_manager.cc
@@ -22,6 +22,7 @@
#include "cc/base/devtools_instrumentation.h"
#include "cc/base/histograms.h"
#include "cc/layers/picture_layer_impl.h"
+#include "cc/paint/display_item_list.h"
#include "cc/raster/paint_worklet_image_provider.h"
#include "cc/raster/playback_image_provider.h"
#include "cc/raster/raster_buffer.h"
@@ -352,6 +353,17 @@ class DidFinishRunningAllTilesTask : public TileTask {
CompletionCb completion_cb_;
};
+gfx::ContentColorUsage GetContentColorUsageForPrioritizedTile(
+ const PrioritizedTile& prioritized_tile) {
+ // TODO(cblume,ccameron): Add support for HDR.
+ bool contains_only_srgb_images = prioritized_tile.raster_source()
+ ->GetDisplayItemList()
+ ->discardable_image_map()
+ .contains_only_srgb_images();
+ return contains_only_srgb_images ? gfx::ContentColorUsage::kSRGB
+ : gfx::ContentColorUsage::kWideColorGamut;
+}
+
} // namespace
RasterTaskCompletionStats::RasterTaskCompletionStats()
@@ -465,8 +477,9 @@ void TileManager::Release(Tile* tile) {
void TileManager::DidFinishRunningTileTasksRequiredForActivation() {
TRACE_EVENT0("cc",
"TileManager::DidFinishRunningTileTasksRequiredForActivation");
- TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
- ScheduledTasksStateAsValue());
+ TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("cc", "ScheduledTasksState",
+ TRACE_ID_LOCAL(this), "state",
+ ScheduledTasksStateAsValue());
// TODO(vmpstr): Temporary check to debug crbug.com/642927.
CHECK(tile_task_manager_);
signals_.activate_tile_tasks_completed = true;
@@ -475,8 +488,9 @@ void TileManager::DidFinishRunningTileTasksRequiredForActivation() {
void TileManager::DidFinishRunningTileTasksRequiredForDraw() {
TRACE_EVENT0("cc", "TileManager::DidFinishRunningTileTasksRequiredForDraw");
- TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
- ScheduledTasksStateAsValue());
+ TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("cc", "ScheduledTasksState",
+ TRACE_ID_LOCAL(this), "state",
+ ScheduledTasksStateAsValue());
// TODO(vmpstr): Temporary check to debug crbug.com/642927.
CHECK(tile_task_manager_);
signals_.draw_tile_tasks_completed = true;
@@ -485,7 +499,7 @@ void TileManager::DidFinishRunningTileTasksRequiredForDraw() {
void TileManager::DidFinishRunningAllTileTasks(bool has_pending_queries) {
TRACE_EVENT0("cc", "TileManager::DidFinishRunningAllTileTasks");
- TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this);
+ TRACE_EVENT_NESTABLE_ASYNC_END0("cc", "ScheduledTasks", TRACE_ID_LOCAL(this));
DCHECK(resource_pool_);
DCHECK(tile_task_manager_);
@@ -677,8 +691,6 @@ 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));
@@ -719,6 +731,11 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
continue;
}
+ auto content_color_usage =
+ GetContentColorUsageForPrioritizedTile(prioritized_tile);
+ const gfx::ColorSpace raster_color_space =
+ client_->GetRasterColorSpace(content_color_usage);
+
// Tiles in the raster queue should either require raster or decode for
// checker-images. If this tile does not need raster, process it only to
// build the decode queue for checkered images.
@@ -797,8 +814,8 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
} else {
// Creating the raster task here will acquire resources, but
// this resource usage has already been accounted for above.
- auto raster_task = CreateRasterTask(
- prioritized_tile, client_->GetRasterColorSpace(), &work_to_schedule);
+ auto raster_task = CreateRasterTask(prioritized_tile, raster_color_space,
+ &work_to_schedule);
if (!raster_task) {
continue;
}
@@ -834,6 +851,11 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() {
if (!prioritized_tile.should_decode_checkered_images_for_tile())
continue;
+ auto content_color_usage =
+ GetContentColorUsageForPrioritizedTile(prioritized_tile);
+ gfx::ColorSpace raster_color_space =
+ client_->GetRasterColorSpace(content_color_usage);
+
Tile* tile = prioritized_tile.tile();
if (tile->draw_info().is_checker_imaged() ||
tile->raster_task_scheduled_with_checker_images()) {
@@ -950,7 +972,8 @@ void TileManager::ScheduleTasks(PrioritizedWorkToSchedule work_to_schedule) {
DCHECK(did_check_for_completed_tasks_since_last_schedule_tasks_);
if (!has_scheduled_tile_tasks_) {
- TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this);
+ TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("cc", "ScheduledTasks",
+ TRACE_ID_LOCAL(this));
}
// Cancel existing OnTaskSetFinished callbacks.
@@ -970,8 +993,6 @@ void TileManager::ScheduleTasks(PrioritizedWorkToSchedule work_to_schedule) {
graph_.Reset();
- gfx::ColorSpace raster_color_space = client_->GetRasterColorSpace();
-
scoped_refptr<TileTask> required_for_activation_done_task =
CreateTaskSetFinishedTask(
&TileManager::DidFinishRunningTileTasksRequiredForActivation);
@@ -1025,6 +1046,11 @@ void TileManager::ScheduleTasks(PrioritizedWorkToSchedule work_to_schedule) {
work_to_schedule.tiles_to_process_for_images;
std::vector<DrawImage> new_locked_images;
for (const PrioritizedTile& prioritized_tile : tiles_to_process_for_images) {
+ auto content_color_usage =
+ GetContentColorUsageForPrioritizedTile(prioritized_tile);
+ gfx::ColorSpace raster_color_space =
+ client_->GetRasterColorSpace(content_color_usage);
+
std::vector<DrawImage> sync_decoded_images;
std::vector<PaintImage> checkered_images;
PartitionImagesForCheckering(prioritized_tile, raster_color_space,
@@ -1115,8 +1141,9 @@ void TileManager::ScheduleTasks(PrioritizedWorkToSchedule work_to_schedule) {
did_check_for_completed_tasks_since_last_schedule_tasks_ = false;
- TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
- ScheduledTasksStateAsValue());
+ TRACE_EVENT_NESTABLE_ASYNC_INSTANT1("cc", "ScheduledTasksState",
+ TRACE_ID_LOCAL(this), "state",
+ ScheduledTasksStateAsValue());
}
scoped_refptr<TileTask> TileManager::CreateRasterTask(
@@ -1139,7 +1166,7 @@ scoped_refptr<TileTask> TileManager::CreateRasterTask(
if (UsePartialRaster(msaa_sample_count) && tile->invalidated_id()) {
resource = resource_pool_->TryAcquireResourceForPartialRaster(
tile->id(), tile->invalidated_content_rect(), tile->invalidated_id(),
- &invalidated_rect);
+ &invalidated_rect, raster_color_space);
}
bool partial_tile_decode = false;