From 9193034b79e3dea131a859e136302cf5ec3e44ff Mon Sep 17 00:00:00 2001 From: "piman@chromium.org" Date: Mon, 12 Mar 2012 19:51:22 +0000 Subject: Fix --single-process mode issues with GpuChannelHostFactory GpuChannelHostFactory itself is no longer a singleton, we pass it explicitly to WebGraphicsContext3DCommandBufferImpl. That prevents RenderThreadImpl and BrowserGpuChannelHostFactory from stomping on each other in --single-process mode BUG=117594 TEST=see bug Review URL: http://codereview.chromium.org/9667012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126194 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/renderer_host/image_transport_factory.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'content/browser/renderer_host/image_transport_factory.cc') diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc index cb074a5..b8b79ed 100644 --- a/content/browser/renderer_host/image_transport_factory.cc +++ b/content/browser/renderer_host/image_transport_factory.cc @@ -12,6 +12,7 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "content/browser/gpu/gpu_surface_tracker.h" +#include "content/browser/gpu/browser_gpu_channel_host_factory.h" #include "content/browser/renderer_host/image_transport_client.h" #include "content/common/gpu/client/command_buffer_proxy.h" #include "content/common/gpu/client/gpu_channel_host.h" @@ -26,6 +27,8 @@ #include "ui/gfx/size.h" #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" +using content::BrowserGpuChannelHostFactory; + namespace { ImageTransportFactory* g_factory; @@ -233,9 +236,10 @@ class GpuProcessTransportFactory : public ui::ContextFactory, WebKit::WebGraphicsContext3D::Attributes attrs; attrs.shareResources = true; + GpuChannelHostFactory* factory = BrowserGpuChannelHostFactory::instance(); scoped_ptr context( new WebGraphicsContext3DCommandBufferImpl( - data->surface_id, GURL(), data->swap_client->AsWeakPtr())); + data->surface_id, GURL(), factory, data->swap_client->AsWeakPtr())); if (!context->Initialize(attrs)) return NULL; return context.release(); @@ -362,10 +366,11 @@ class GpuProcessTransportFactory : public ui::ContextFactory, data->swap_client.reset(new CompositorSwapClient(compositor, this)); + GpuChannelHostFactory* factory = BrowserGpuChannelHostFactory::instance(); WebKit::WebGraphicsContext3D::Attributes attrs; attrs.shareResources = true; data->shared_context.reset(new WebGraphicsContext3DCommandBufferImpl( - data->surface_id, GURL(), data->swap_client->AsWeakPtr())); + data->surface_id, GURL(), factory, data->swap_client->AsWeakPtr())); if (!data->shared_context->Initialize(attrs)) { // If we can't recreate contexts, we won't be able to show the UI. Better // crash at this point. -- cgit v1.1