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

Unified Diff: content/renderer/render_widget.cc

Issue 1916923004: Request context sharing via content::ContextProviderCommandBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sharegroup: . Created 4 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
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 5f7490d632fbad1b22c19e3d97d26b24428ed836..cc12222aaf5e4673ab094acf492ae7957a3df35e 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -220,12 +220,11 @@ CreateOffscreenContext(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
attributes.bind_generates_resource = false;
attributes.lose_context_when_out_of_memory = true;
- bool share_resources = true;
bool automatic_flushes = false;
return base::WrapUnique(new content::WebGraphicsContext3DCommandBufferImpl(
gpu::kNullSurfaceHandle, url, gpu_channel_host.get(), attributes,
- gfx::PreferIntegratedGpu, share_resources, automatic_flushes, nullptr));
+ gfx::PreferIntegratedGpu, automatic_flushes));
}
} // namespace
@@ -785,10 +784,6 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
limits.start_transfer_buffer_size = 64 * 1024;
limits.min_transfer_buffer_size = 64 * 1024;
- context_provider = new ContextProviderCommandBuffer(
- CreateOffscreenContext(std::move(gpu_channel_host),
- GetURLForGraphicsContext3D()),
- limits, RENDER_COMPOSITOR_CONTEXT);
worker_context_provider =
RenderThreadImpl::current()->SharedWorkerContextProvider();
if (!worker_context_provider) {
@@ -796,6 +791,12 @@ std::unique_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(
return nullptr;
}
+ // The compositor context shares resources with the worker context.
+ context_provider = new ContextProviderCommandBuffer(
+ CreateOffscreenContext(std::move(gpu_channel_host),
+ GetURLForGraphicsContext3D()),
+ limits, worker_context_provider.get(), RENDER_COMPOSITOR_CONTEXT);
+
#if defined(OS_ANDROID)
if (RenderThreadImpl::current() &&
RenderThreadImpl::current()->sync_compositor_message_filter()) {

Powered by Google App Engine
This is Rietveld 408576698