diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-08-09 13:09:54 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-10-16 13:38:18 +0000 |
commit | acbcf08a6dffdfe90a6eaf661fcd6923f0de2447 (patch) | |
tree | 749564d8cf9b3d49cdae1cce9ec8ce0602900f1c /chromium/cc/tiles/tile_manager.cc | |
parent | 266cfa0fb83513250bcefd8234e0916c195a4b2e (diff) |
BASELINE: Update Chromium to 114.0.5735.248
Change-Id: Ie7ddd5d87175d4bde196f774c742cdbb9d5d311a
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/495463
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/cc/tiles/tile_manager.cc')
-rw-r--r-- | chromium/cc/tiles/tile_manager.cc | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/chromium/cc/tiles/tile_manager.cc b/chromium/cc/tiles/tile_manager.cc index 6b015dd5074..c5a51c1c2b2 100644 --- a/chromium/cc/tiles/tile_manager.cc +++ b/chromium/cc/tiles/tile_manager.cc @@ -596,11 +596,11 @@ bool TileManager::PrepareTiles( return true; } -void TileManager::CheckForCompletedTasks() { - TRACE_EVENT0("cc", "TileManager::CheckForCompletedTasks"); +void TileManager::PrepareToDraw() { + TRACE_EVENT0("cc", "TileManager::PrepareToDraw"); if (!tile_task_manager_) { - TRACE_EVENT_INSTANT0("cc", "TileManager::CheckForCompletedTasksAborted", + TRACE_EVENT_INSTANT0("cc", "TileManager::PrepareToDrawAborted", TRACE_EVENT_SCOPE_THREAD); return; } @@ -608,12 +608,16 @@ void TileManager::CheckForCompletedTasks() { tile_task_manager_->CheckForCompletedTasks(); did_check_for_completed_tasks_since_last_schedule_tasks_ = true; + if (base::FeatureList::IsEnabled(features::kFlushGpuAtDraw)) { + // Flush the GPU before calling SetReadyToDrawCallback, which happens in + // CheckPendingGpuWorkAndIssueSignals. + raster_buffer_provider_->Flush(); + } CheckPendingGpuWorkAndIssueSignals(); TRACE_EVENT_INSTANT1( - "cc", "TileManager::CheckForCompletedTasksFinished", - TRACE_EVENT_SCOPE_THREAD, "stats", - RasterTaskCompletionStatsAsValue(raster_task_completion_stats_)); + "cc", "TileManager::PrepareToDrawFinished", TRACE_EVENT_SCOPE_THREAD, + "stats", RasterTaskCompletionStatsAsValue(raster_task_completion_stats_)); raster_task_completion_stats_ = RasterTaskCompletionStats(); } @@ -806,7 +810,7 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() { MemoryUsage memory_required_by_tile_to_be_scheduled; if (!tile->raster_task_.get()) { memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( - tile->desired_texture_size(), DetermineResourceFormat(tile)); + tile->desired_texture_size(), DetermineFormat(tile)); } // This is the memory limit that will be used by this tile. Depending on @@ -1205,11 +1209,11 @@ scoped_refptr<TileTask> TileManager::CreateRasterTask( // // TODO(crbug.com/1076568): Once we have access to the display's buffer format // via gfx::DisplayColorSpaces, we should also do this for HBD images. - auto format = DetermineResourceFormat(tile); + auto format = DetermineFormat(tile); if (target_color_params.color_space.IsHDR() && GetContentColorUsageForPrioritizedTile(prioritized_tile) == gfx::ContentColorUsage::kHDR) { - format = viz::ResourceFormat::RGBA_F16; + format = viz::SinglePlaneFormat::kRGBA_F16; } // Get the resource. @@ -1693,9 +1697,8 @@ void TileManager::NeedsInvalidationForCheckerImagedTiles() { client_->RequestImplSideInvalidationForCheckerImagedTiles(); } -viz::ResourceFormat TileManager::DetermineResourceFormat( - const Tile* tile) const { - return raster_buffer_provider_->GetResourceFormat(); +viz::SharedImageFormat TileManager::DetermineFormat(const Tile* tile) const { + return raster_buffer_provider_->GetFormat(); } std::unique_ptr<base::trace_event::ConvertableToTraceFormat> @@ -1816,13 +1819,13 @@ TileManager::ActivationStateAsValue() { } void TileManager::ActivationStateAsValueInto( - base::trace_event::TracedValue* state) { + base::trace_event::TracedValue* state) const { state->SetString("tree_priority", TreePriorityToString(global_state_.tree_priority)); state->SetInteger("soft_memory_limit", global_state_.soft_memory_limit_in_bytes); state->SetInteger("hard_memory_limit", - global_state_.soft_memory_limit_in_bytes); + global_state_.hard_memory_limit_in_bytes); state->SetInteger("pending_required_for_activation_callback_id", pending_required_for_activation_callback_id_); state->SetInteger("current_memory_usage", @@ -1878,6 +1881,12 @@ bool TileManager::ShouldRasterOccludedTiles() const { global_state_.memory_limit_policy != ALLOW_ABSOLUTE_MINIMUM); } +std::string TileManager::GetHungCommitDebugInfo() const { + base::trace_event::TracedValueJSON value; + ActivationStateAsValueInto(&value); + return value.ToJSON(); +} + TileManager::MemoryUsage::MemoryUsage() : memory_bytes_(0), resource_count_(0) {} @@ -1898,12 +1907,11 @@ TileManager::MemoryUsage::MemoryUsage(size_t memory_bytes, // static TileManager::MemoryUsage TileManager::MemoryUsage::FromConfig( const gfx::Size& size, - viz::ResourceFormat format) { - // We can use UncheckedSizeInBytes here since this is used with a tile + viz::SharedImageFormat format) { + // We don't need to validate the computed size since this is used with a tile // size which is determined by the compositor (it's at most max texture // size). - return MemoryUsage( - viz::ResourceSizes::UncheckedSizeInBytes<size_t>(size, format), 1); + return MemoryUsage(format.EstimatedSizeInBytes(size), 1); } // static |