[go: nahoru, domu]

[cc] Run OneCopyRasterBufferProvider playback at normal thread priority.

OneCopyRasterBufferProvider::Playback() acquires the GpuChannelHost,
which is also acquired from high priority tasks. It should not run
at background thread priority because that can cause priority
inversions, as shown by Slow Reports (see the bug).

A follow-up CL https://crrev.com/c/2157659 adds a DCHECK to ensure
that the GpuChannelHost lock does not cause other priority inversions
than the one fixed in this CL.

Bug: 1072756
Change-Id: I3cd7bd9a67e15c0079db35aeab3d1805e2b61835
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2240141
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784112}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index 4dbb25b..3b94b67 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -352,6 +352,11 @@
       depends_on_hardware_accelerated_webp_candidates_);
 }
 
+bool GpuRasterBufferProvider::RasterBufferImpl::
+    SupportsBackgroundThreadPriority() const {
+  return true;
+}
+
 GpuRasterBufferProvider::GpuRasterBufferProvider(
     viz::ContextProvider* compositor_context_provider,
     viz::RasterContextProvider* worker_context_provider,