summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 20:21:24 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 20:21:24 +0000
commitf0ee0c93483f65a790fc974ea5a913798ee736a8 (patch)
tree1e5d0f9f567a2223759675eb6b2ff71871253e6d /chrome
parent8fbb4a2617cc5bcf61cc9c8a947d1b391f996b7e (diff)
downloadchromium_src-f0ee0c93483f65a790fc974ea5a913798ee736a8.zip
chromium_src-f0ee0c93483f65a790fc974ea5a913798ee736a8.tar.gz
chromium_src-f0ee0c93483f65a790fc974ea5a913798ee736a8.tar.bz2
Added implementations of entry points which will shortly be added
upstream for implementing the compositor on top of GraphicsContext3D. BUG=55750 TEST=none Review URL: http://codereview.chromium.org/3430008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc56
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.h26
2 files changed, 82 insertions, 0 deletions
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 9a57aa8..f5dac44 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -39,6 +39,15 @@ WebGraphicsContext3DCommandBufferImpl::
bool WebGraphicsContext3DCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes,
+ WebKit::WebView* web_view,
+ bool render_directly_to_web_view) {
+ // TODO(kbr): implement this fully once WebView::graphicsContext3D()
+ // is exposed upstream.
+ return initialize(attributes, web_view);
+}
+
+bool WebGraphicsContext3DCommandBufferImpl::initialize(
+ WebGraphicsContext3D::Attributes attributes,
WebKit::WebView* web_view) {
bool compositing_enabled = !CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableAcceleratedCompositing);
@@ -254,6 +263,53 @@ bool WebGraphicsContext3DCommandBufferImpl::supportsBGRA() {
return is_supported;
}
+bool WebGraphicsContext3DCommandBufferImpl::supportsMapSubCHROMIUM() {
+ static bool is_supported = supports_extension("GL_CHROMIUM_map_sub");
+ return is_supported;
+}
+
+void* WebGraphicsContext3DCommandBufferImpl::mapBufferSubDataCHROMIUM(
+ unsigned target,
+ int offset,
+ int size,
+ unsigned access) {
+ return glMapBufferSubData(target, offset, size, access);
+}
+
+void WebGraphicsContext3DCommandBufferImpl::unmapBufferSubDataCHROMIUM(
+ const void* mem) {
+ return glUnmapBufferSubData(mem);
+}
+
+void* WebGraphicsContext3DCommandBufferImpl::mapTexSubImage2DCHROMIUM(
+ unsigned target,
+ int level,
+ int xoffset,
+ int yoffset,
+ int width,
+ int height,
+ unsigned format,
+ unsigned type,
+ unsigned access) {
+ return glMapTexSubImage2D(
+ target, level, xoffset, yoffset, width, height, format, type, access);
+}
+
+void WebGraphicsContext3DCommandBufferImpl::unmapTexSubImage2DCHROMIUM(
+ const void* mem) {
+ glUnmapTexSubImage2D(mem);
+}
+
+bool WebGraphicsContext3DCommandBufferImpl::
+ supportsCopyTextureToParentTextureCHROMIUM() {
+ return true;
+}
+
+void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM(
+ unsigned texture, unsigned parentTexture) {
+ copyTextureToCompositor(texture, parentTexture);
+}
+
// Helper macros to reduce the amount of code.
#define DELEGATE_TO_GL(name, glname) \
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
index d32952e..6a4c11e 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
@@ -41,6 +41,12 @@ class WebGraphicsContext3DCommandBufferImpl
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
virtual bool initialize(WebGraphicsContext3D::Attributes attributes,
+ WebKit::WebView*,
+ bool renderDirectlyToWebView);
+
+ // TODO(kbr): remove this overload once upstream code no longer
+ // defines this virtual.
+ virtual bool initialize(WebGraphicsContext3D::Attributes attributes,
WebKit::WebView*);
virtual bool makeContextCurrent();
@@ -341,6 +347,26 @@ class WebGraphicsContext3DCommandBufferImpl
virtual void synthesizeGLError(unsigned long error);
virtual bool supportsBGRA();
+ virtual bool supportsMapSubCHROMIUM();
+ virtual void* mapBufferSubDataCHROMIUM(
+ unsigned target, int offset, int size, unsigned access);
+ virtual void unmapBufferSubDataCHROMIUM(const void*);
+ virtual void* mapTexSubImage2DCHROMIUM(
+ unsigned target,
+ int level,
+ int xoffset,
+ int yoffset,
+ int width,
+ int height,
+ unsigned format,
+ unsigned type,
+ unsigned access);
+ virtual void unmapTexSubImage2DCHROMIUM(const void*);
+
+ virtual bool supportsCopyTextureToParentTextureCHROMIUM();
+ virtual void copyTextureToParentTextureCHROMIUM(
+ unsigned texture, unsigned parentTexture);
+
virtual unsigned createCompositorTexture(unsigned width, unsigned height);
virtual void deleteCompositorTexture(unsigned parent_texture);
virtual void copyTextureToCompositor(unsigned texture,