diff options
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/render_view_impl.cc | 18 | ||||
-rw-r--r-- | content/renderer/renderer_webkitplatformsupport_impl.cc | 34 | ||||
-rw-r--r-- | content/renderer/renderer_webkitplatformsupport_impl.h | 1 |
3 files changed, 13 insertions, 40 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 240d426..767523e 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -1493,20 +1493,16 @@ WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( // The WebGraphicsContext3DInProcessImpl code path is used for // layout tests (though not through this code) as well as for // debugging and bringing up new ports. - scoped_ptr<WebGraphicsContext3D> context; if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { - context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( - gfx::kNullPluginWindow, NULL)); + return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( + attributes, webview(), direct); } else { -#if defined(ENABLE_GPU) - context.reset(new WebGraphicsContext3DCommandBufferImpl()); -#else - return NULL; -#endif + scoped_ptr<WebGraphicsContext3D> context( + new WebGraphicsContext3DCommandBufferImpl()); + if (!context->initialize(attributes, webview(), direct)) + return NULL; + return context.release(); } - if (!context->initialize(attributes, webview(), direct)) - return NULL; - return context.release(); } void RenderViewImpl::didAddMessageToConsole( diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 7e0f796..5e62910 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -36,7 +36,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegistry.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" @@ -565,42 +564,21 @@ RendererWebKitPlatformSupportImpl::sharedWorkerRepository() { } WebKit::WebGraphicsContext3D* -RendererWebKitPlatformSupportImpl::createGraphicsContext3D() { - // The WebGraphicsContext3DInProcessImpl code path is used for - // layout tests (though not through this code) as well as for - // debugging and bringing up new ports. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { - return new webkit::gpu::WebGraphicsContext3DInProcessImpl( - gfx::kNullPluginWindow, NULL); - } else { -#if defined(ENABLE_GPU) - return new WebGraphicsContext3DCommandBufferImpl(); -#else - return NULL; -#endif - } -} - -WebKit::WebGraphicsContext3D* RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( const WebGraphicsContext3D::Attributes& attributes) { // The WebGraphicsContext3DInProcessImpl code path is used for // layout tests (though not through this code) as well as for // debugging and bringing up new ports. - scoped_ptr<WebGraphicsContext3D> context; if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { - context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( - gfx::kNullPluginWindow, NULL)); + return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( + attributes, NULL, false); } else { -#if defined(ENABLE_GPU) + scoped_ptr<WebGraphicsContext3D> context; context.reset(new WebGraphicsContext3DCommandBufferImpl()); -#else - return NULL; -#endif + if (!context->initialize(attributes, NULL, false)) + return NULL; + return context.release(); } - if (!context->initialize(attributes, NULL, false)) - return NULL; - return context.release(); } double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h index b8fe5b3..9b56977 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.h +++ b/content/renderer/renderer_webkitplatformsupport_impl.h @@ -82,7 +82,6 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl const WebKit::WebString& keyPath) OVERRIDE; virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE; - virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() OVERRIDE; virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( const WebKit::WebGraphicsContext3D::Attributes& attributes); virtual double audioHardwareSampleRate() OVERRIDE; |