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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1898423005: Remove the browser shared context from the compositor share group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ui-share: . 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 7bf913c4e8d35654f6435ae7e1fead4ad95276a4..a93b0482ddd4492cb9ba896cde5768a82b84ebf9 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -88,7 +88,8 @@ const int kNumRetriesBeforeSoftwareFallback = 4;
std::unique_ptr<content::WebGraphicsContext3DCommandBufferImpl>
CreateContextCommon(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
- gpu::SurfaceHandle surface_handle) {
+ gpu::SurfaceHandle surface_handle,
+ bool share_resources) {
DCHECK(
content::GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor());
DCHECK(gpu_channel_host);
@@ -114,7 +115,6 @@ CreateContextCommon(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;
GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon");
@@ -333,8 +333,10 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// This context is used for both the browser compositor and the display
// compositor.
+ constexpr bool share_resources = true;
context_provider = new ContextProviderCommandBuffer(
- CreateContextCommon(gpu_channel_host, surface_handle),
+ CreateContextCommon(gpu_channel_host, surface_handle,
+ share_resources),
gpu::SharedMemoryLimits(), DISPLAY_COMPOSITOR_ONSCREEN_CONTEXT);
if (!context_provider->BindToCurrentThread())
context_provider = nullptr;
@@ -342,7 +344,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
if (!shared_worker_context_provider_) {
shared_worker_context_provider_ = new ContextProviderCommandBuffer(
CreateContextCommon(std::move(gpu_channel_host),
- gpu::kNullSurfaceHandle),
+ gpu::kNullSurfaceHandle, share_resources),
gpu::SharedMemoryLimits(), BROWSER_WORKER_CONTEXT);
if (shared_worker_context_provider_->BindToCurrentThread())
shared_worker_context_provider_->SetupLock();
@@ -625,8 +627,10 @@ GpuProcessTransportFactory::SharedMainThreadContextProvider() {
// We need a separate context from the compositor's so that skia and gl_helper
// don't step on each other.
+ bool share_resources = false;
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);
shared_main_thread_contexts_->SetLostContextCallback(base::Bind(
&GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698