Commit e29f42a6 authored by danakj's avatar danakj Committed by Commit bot

Remove the renderer shared context from the compositor share group.

This context is used by canvas and video, which speak to the
compositor through mailboxes.

R=piman, sievers
BUG=584497

Review URL: https://codereview.chromium.org/1903863003

Cr-Commit-Position: refs/heads/master@{#388628}
parent a586e644
...@@ -447,7 +447,8 @@ void StringToUintVector(const std::string& str, std::vector<unsigned>* vector) { ...@@ -447,7 +447,8 @@ void StringToUintVector(const std::string& str, std::vector<unsigned>* vector) {
} }
std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext( std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext(
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
bool share_resources) {
DCHECK(gpu_channel_host); DCHECK(gpu_channel_host);
// This is used to create a few different offscreen contexts: // This is used to create a few different offscreen contexts:
// - The shared main thread context (offscreen) used by blink for canvas. // - The shared main thread context (offscreen) used by blink for canvas.
...@@ -462,8 +463,7 @@ std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext( ...@@ -462,8 +463,7 @@ std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext(
attributes.sample_buffers = 0; attributes.sample_buffers = 0;
attributes.bind_generates_resource = false; attributes.bind_generates_resource = false;
attributes.lose_context_when_out_of_memory = true; attributes.lose_context_when_out_of_memory = true;
bool share_resources = true; constexpr bool automatic_flushes = false;
bool automatic_flushes = false;
return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( return base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
gpu::kNullSurfaceHandle, gpu::kNullSurfaceHandle,
GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"),
...@@ -1506,8 +1506,9 @@ RenderThreadImpl::SharedMainThreadContextProvider() { ...@@ -1506,8 +1506,9 @@ RenderThreadImpl::SharedMainThreadContextProvider() {
return nullptr; return nullptr;
} }
constexpr bool share_resources = false;
shared_main_thread_contexts_ = new ContextProviderCommandBuffer( shared_main_thread_contexts_ = new ContextProviderCommandBuffer(
CreateOffscreenContext(std::move(gpu_channel_host)), CreateOffscreenContext(std::move(gpu_channel_host), share_resources),
gpu::SharedMemoryLimits(), RENDERER_MAINTHREAD_CONTEXT); gpu::SharedMemoryLimits(), RENDERER_MAINTHREAD_CONTEXT);
if (!shared_main_thread_contexts_->BindToCurrentThread()) if (!shared_main_thread_contexts_->BindToCurrentThread())
shared_main_thread_contexts_ = nullptr; shared_main_thread_contexts_ = nullptr;
...@@ -2017,8 +2018,9 @@ RenderThreadImpl::SharedWorkerContextProvider() { ...@@ -2017,8 +2018,9 @@ RenderThreadImpl::SharedWorkerContextProvider() {
return shared_worker_context_provider_; return shared_worker_context_provider_;
} }
constexpr bool share_resources = true;
shared_worker_context_provider_ = new ContextProviderCommandBuffer( shared_worker_context_provider_ = new ContextProviderCommandBuffer(
CreateOffscreenContext(std::move(gpu_channel_host)), CreateOffscreenContext(std::move(gpu_channel_host), share_resources),
gpu::SharedMemoryLimits(), RENDER_WORKER_CONTEXT); gpu::SharedMemoryLimits(), RENDER_WORKER_CONTEXT);
if (!shared_worker_context_provider_->BindToCurrentThread()) if (!shared_worker_context_provider_->BindToCurrentThread())
shared_worker_context_provider_ = nullptr; shared_worker_context_provider_ = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment