summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 05:39:06 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-31 05:39:06 +0000
commit01e6903959b36f9d7195a8d48e8c38fd3cc2886a (patch)
tree0cd9e3233b00dfb96d5733adffdc1a4853eac852 /content/renderer
parent34694763d71c8d8306a17a7762eeb89db59adba6 (diff)
downloadchromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.zip
chromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.tar.gz
chromium_src-01e6903959b36f9d7195a8d48e8c38fd3cc2886a.tar.bz2
Add WebKitPlatformSupport::createOffscreenGraphicsContext3D
This is in preparation of https://bugs.webkit.org/show_bug.cgi?id=76593 BUG=99516 TEST=manually ran Chrome w/accelerated content, DRT, test_shell_tests. Review URL: http://codereview.chromium.org/9297046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/render_view_impl.cc2
-rw-r--r--content/renderer/render_view_impl.h2
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.cc22
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.h3
4 files changed, 27 insertions, 2 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index e8a32e1..c8eb610 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1473,7 +1473,7 @@ WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace(
}
WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D(
- WebGraphicsContext3D::Attributes attributes,
+ const WebGraphicsContext3D::Attributes& attributes,
bool direct) {
if (!webview())
return NULL;
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index e8728f4..b892a80 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -342,7 +342,7 @@ class RenderViewImpl : public RenderWidget,
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(
unsigned quota);
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(
- WebKit::WebGraphicsContext3D::Attributes attributes,
+ const WebKit::WebGraphicsContext3D::Attributes& attributes,
bool direct);
virtual void didAddMessageToConsole(
const WebKit::WebConsoleMessage& message,
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 80bb6fa..7e0f796 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -581,6 +581,28 @@ RendererWebKitPlatformSupportImpl::createGraphicsContext3D() {
}
}
+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));
+ } else {
+#if defined(ENABLE_GPU)
+ context.reset(new WebGraphicsContext3DCommandBufferImpl());
+#else
+ return NULL;
+#endif
+ }
+ if (!context->initialize(attributes, NULL, false))
+ return NULL;
+ return context.release();
+}
+
double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() {
return audio_hardware::GetOutputSampleRate();
}
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h
index b7eadeb..b8fe5b3 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.h
+++ b/content/renderer/renderer_webkitplatformsupport_impl.h
@@ -11,6 +11,7 @@
#include "base/platform_file.h"
#include "content/common/content_export.h"
#include "content/common/webkitplatformsupport_impl.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h"
class RendererClipboardClient;
class WebSharedWorkerRepositoryImpl;
@@ -82,6 +83,8 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
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;
virtual size_t audioHardwareBufferSize() OVERRIDE;
virtual WebKit::WebAudioDevice* createAudioDevice(