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

Unified Diff: content/renderer/render_widget.cc

Issue 1949023005: gpu: Add flag for enabling asynchronous worker context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase fix Created 4 years, 7 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 | « content/renderer/render_thread_impl.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index fb309d7b86e37e32daf668e308166df76f4c2284..3f5ea076bf9dfdedbd62cb9b5258dd722d9452ef 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -777,13 +777,19 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
constexpr bool automatic_flushes = false;
- // The compositor context shares resources with the worker context.
- scoped_refptr<ContextProviderCommandBuffer> context_provider(
- new ContextProviderCommandBuffer(
- std::move(gpu_channel_host), gpu::kNullSurfaceHandle,
- GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu,
- automatic_flushes, limits, attributes, worker_context_provider.get(),
- command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT));
+ // The compositor context shares resources with the worker context unless
+ // the worker is async.
+ ContextProviderCommandBuffer* share_context = worker_context_provider.get();
+ if (compositor_deps_->IsAsyncWorkerContextEnabled())
+ share_context = nullptr;
+
+ scoped_refptr<ContextProviderCommandBuffer> context_provider(
+ new ContextProviderCommandBuffer(
+ std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT,
+ gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle,
+ GetURLForGraphicsContext3D(), gfx::PreferIntegratedGpu,
+ automatic_flushes, limits, attributes, share_context,
+ command_buffer_metrics::RENDER_COMPOSITOR_CONTEXT));
#if defined(OS_ANDROID)
if (RenderThreadImpl::current()->sync_compositor_message_filter()) {
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/renderer/renderer_blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698