summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 23:13:57 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 23:13:57 +0000
commit56200f01b42fc298eb187eac78b82c85eacedac0 (patch)
tree2fdbc217ace5744c3e5afd1c9f3fa3aa25df5cd1 /content/renderer
parent4a3ce97a93e8b43082c4ae243ac8127c92890b28 (diff)
downloadchromium_src-56200f01b42fc298eb187eac78b82c85eacedac0.zip
chromium_src-56200f01b42fc298eb187eac78b82c85eacedac0.tar.gz
chromium_src-56200f01b42fc298eb187eac78b82c85eacedac0.tar.bz2
Refactor WebGraphicsContext3DInProcess and TestWebGraphicsContext3D
This needs https://bugs.webkit.org/show_bug.cgi?id=76593 to land first. This also removes WebKitPlatformSupport::createGraphicsContext3D implementations that are not called any more after the above. BUG=None TEST=chrome with accelerated content, DRT, test_shell_tests Review URL: http://codereview.chromium.org/9226036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/render_view_impl.cc18
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.cc34
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.h1
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;