Index: 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 4e27a799a6c07302fce5d64c52ad7db61fd5d72e..72d6860bcc55ea9d3e40303fe087c8c5fe349fe0 100644 |
--- a/content/browser/renderer_host/image_transport_factory.cc |
+++ b/content/browser/renderer_host/image_transport_factory.cc |
@@ -485,12 +485,12 @@ class BrowserCompositorOutputSurface |
public base::NonThreadSafe { |
public: |
BrowserCompositorOutputSurface( |
- WebGraphicsContext3DCommandBufferImpl* context, |
+ scoped_ptr<WebKit::WebGraphicsContext3D> context, |
int surface_id, |
BrowserCompositorOutputSurfaceProxy* output_surface_proxy, |
base::MessageLoopProxy* compositor_message_loop, |
base::WeakPtr<ui::Compositor> compositor) |
- : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context)), |
+ : OutputSurface(context.Pass()), |
surface_id_(surface_id), |
output_surface_proxy_(output_surface_proxy), |
compositor_message_loop_(compositor_message_loop), |
@@ -628,23 +628,28 @@ class GpuProcessTransportFactory |
DCHECK(per_compositor_data_.empty()); |
} |
- virtual WebGraphicsContext3DCommandBufferImpl* CreateOffscreenContext() |
- OVERRIDE { |
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
+ CreateOffscreenCommandBufferContext() { |
base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client; |
return CreateContextCommon(swap_client, 0); |
} |
+ virtual scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext() |
+ OVERRIDE { |
+ return CreateOffscreenCommandBufferContext() |
+ .PassAs<WebKit::WebGraphicsContext3D>(); |
+ } |
+ |
virtual cc::OutputSurface* CreateOutputSurface( |
ui::Compositor* compositor) OVERRIDE { |
PerCompositorData* data = per_compositor_data_[compositor]; |
if (!data) |
data = CreatePerCompositorData(compositor); |
- WebGraphicsContext3DCommandBufferImpl* context = |
- CreateContextCommon(data->swap_client->AsWeakPtr(), |
- data->surface_id); |
BrowserCompositorOutputSurface* surface = |
new BrowserCompositorOutputSurface( |
- context, |
+ CreateContextCommon(data->swap_client->AsWeakPtr(), |
+ data->surface_id) |
+ .PassAs<WebKit::WebGraphicsContext3D>(), |
per_compositor_data_[compositor]->surface_id, |
output_surface_proxy_.get(), |
base::MessageLoopProxy::current(), |
@@ -818,7 +823,7 @@ class GpuProcessTransportFactory |
return data; |
} |
- WebGraphicsContext3DCommandBufferImpl* CreateContextCommon( |
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContextCommon( |
const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, |
int surface_id) { |
WebKit::WebGraphicsContext3D::Attributes attrs; |
@@ -839,8 +844,8 @@ class GpuProcessTransportFactory |
attrs, |
false, |
CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)) |
- return NULL; |
- return context.release(); |
+ return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
+ return context.Pass(); |
} |
// Crash given that we are unable to show any UI whatsoever. On Windows we |
@@ -873,7 +878,7 @@ class GpuProcessTransportFactory |
virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
CreateOffscreenContext3d() OVERRIDE { |
- return make_scoped_ptr(factory_->CreateOffscreenContext()); |
+ return factory_->CreateOffscreenCommandBufferContext(); |
} |
virtual void OnLostContext() OVERRIDE { |
@@ -917,7 +922,7 @@ class GpuProcessTransportFactory |
virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
CreateOffscreenContext3d() OVERRIDE { |
- return make_scoped_ptr(factory_->CreateOffscreenContext()); |
+ return factory_->CreateOffscreenCommandBufferContext(); |
} |
private: |
@@ -996,8 +1001,9 @@ class SoftwareContextFactory : public ui::ContextFactory { |
public: |
SoftwareContextFactory() {} |
virtual ~SoftwareContextFactory() {} |
- virtual WebKit::WebGraphicsContext3D* CreateOffscreenContext() OVERRIDE { |
- return NULL; |
+ virtual scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext() |
+ OVERRIDE { |
+ return scoped_ptr<WebKit::WebGraphicsContext3D>(); |
} |
virtual cc::OutputSurface* CreateOutputSurface( |
ui::Compositor* compositor) OVERRIDE { |