Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index a23022d868b4d50e97c987b672a53812c5d68694..2489449b08749d39e58df27f96b14f0b0f2b8441 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -1502,9 +1502,21 @@ WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( |
return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
attributes, webview(), direct); |
} else { |
- scoped_ptr<WebGraphicsContext3D> context( |
- new WebGraphicsContext3DCommandBufferImpl()); |
- if (!context->initialize(attributes, webview(), direct)) |
+ int surface = direct ? surface_id() : 0; |
+ |
+ GURL url; |
+ if (webview()->mainFrame()) |
+ url = GURL(webview()->mainFrame()->document().url()); |
+ |
+ base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client; |
+ if (direct) |
+ swap_client = AsWeakPtr(); |
+ |
+ scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
+ new WebGraphicsContext3DCommandBufferImpl( |
+ surface, url, swap_client)); |
+ |
+ if (!context->Initialize(attributes)) |
return NULL; |
return context.release(); |
} |