summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/image_transport_factory.cc
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 19:51:22 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 19:51:22 +0000
commit9193034b79e3dea131a859e136302cf5ec3e44ff (patch)
treecc0250a101b32c945172ae4108e1ad1b26474a37 /content/browser/renderer_host/image_transport_factory.cc
parent6dfa3014196eb06386074ea2a15906921ce12e4f (diff)
downloadchromium_src-9193034b79e3dea131a859e136302cf5ec3e44ff.zip
chromium_src-9193034b79e3dea131a859e136302cf5ec3e44ff.tar.gz
chromium_src-9193034b79e3dea131a859e136302cf5ec3e44ff.tar.bz2
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
Diffstat (limited to 'content/browser/renderer_host/image_transport_factory.cc')
-rw-r--r--content/browser/renderer_host/image_transport_factory.cc9
1 files changed, 7 insertions, 2 deletions
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<WebGraphicsContext3DCommandBufferImpl> 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.