Commit 45310fbf authored by danakj's avatar danakj Committed by Commit bot

Remove the browser shared context from the compositor share group.

Everything goes through mailboxes when used with this context.

R=piman@chromium.org
BUG=584497

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

Cr-Commit-Position: refs/heads/master@{#388618}
parent 6bf90359
...@@ -93,7 +93,8 @@ const int kNumRetriesBeforeSoftwareFallback = 4; ...@@ -93,7 +93,8 @@ const int kNumRetriesBeforeSoftwareFallback = 4;
std::unique_ptr<content::WebGraphicsContext3DCommandBufferImpl> std::unique_ptr<content::WebGraphicsContext3DCommandBufferImpl>
CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
gpu::SurfaceHandle surface_handle) { gpu::SurfaceHandle surface_handle,
bool share_resources) {
DCHECK( DCHECK(
content::GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()); content::GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor());
DCHECK(gpu_channel_host); DCHECK(gpu_channel_host);
...@@ -119,7 +120,6 @@ CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, ...@@ -119,7 +120,6 @@ CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
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;
bool automatic_flushes = false; bool automatic_flushes = false;
GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
...@@ -343,8 +343,10 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -343,8 +343,10 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// This context is used for both the browser compositor and the display // This context is used for both the browser compositor and the display
// compositor. // compositor.
constexpr bool share_resources = true;
context_provider = new ContextProviderCommandBuffer( context_provider = new ContextProviderCommandBuffer(
CreateContextCommon(gpu_channel_host, surface_handle), CreateContextCommon(gpu_channel_host, surface_handle,
share_resources),
gpu::SharedMemoryLimits(), DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT); gpu::SharedMemoryLimits(), DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT);
if (!context_provider->BindToCurrentThread()) if (!context_provider->BindToCurrentThread())
context_provider = nullptr; context_provider = nullptr;
...@@ -352,7 +354,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( ...@@ -352,7 +354,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
if (!shared_worker_context_provider_) { if (!shared_worker_context_provider_) {
shared_worker_context_provider_ = new ContextProviderCommandBuffer( shared_worker_context_provider_ = new ContextProviderCommandBuffer(
CreateContextCommon(std::move(gpu_channel_host), CreateContextCommon(std::move(gpu_channel_host),
gpu::kNullSurfaceHandle), gpu::kNullSurfaceHandle, share_resources),
gpu::SharedMemoryLimits(), BROWSER_WORKER_CONTEXT); gpu::SharedMemoryLimits(), BROWSER_WORKER_CONTEXT);
if (shared_worker_context_provider_->BindToCurrentThread()) if (shared_worker_context_provider_->BindToCurrentThread())
shared_worker_context_provider_->SetupLock(); shared_worker_context_provider_->SetupLock();
...@@ -656,8 +658,10 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() { ...@@ -656,8 +658,10 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
// We need a separate context from the compositor's so that skia and gl_helper // We need a separate context from the compositor's so that skia and gl_helper
// don't step on each other. // don't step on each other.
bool share_resources = false;
shared_main_thread_contexts_ = new ContextProviderCommandBuffer( shared_main_thread_contexts_ = new ContextProviderCommandBuffer(
CreateContextCommon(std::move(gpu_channel_host), gpu::kNullSurfaceHandle), CreateContextCommon(std::move(gpu_channel_host), gpu::kNullSurfaceHandle,
share_resources),
gpu::SharedMemoryLimits(), BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); gpu::SharedMemoryLimits(), BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT);
shared_main_thread_contexts_->SetLostContextCallback(base::Bind( shared_main_thread_contexts_->SetLostContextCallback(base::Bind(
&GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback, &GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback,
......
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