summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorvangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 21:54:33 +0000
committervangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 21:54:33 +0000
commit6738128e5d2b6bb42eac2fb591d30a0a99b76600 (patch)
tree228ce6b3d7a099348c3e79ea8b9311f89339c57e /chrome/renderer
parent92698ce853664cdd1dee6e7b4a7e6d382dfb8786 (diff)
downloadchromium_src-6738128e5d2b6bb42eac2fb591d30a0a99b76600.zip
chromium_src-6738128e5d2b6bb42eac2fb591d30a0a99b76600.tar.gz
chromium_src-6738128e5d2b6bb42eac2fb591d30a0a99b76600.tar.bz2
Adding a new signature for WebGraphicsContext3DCommandBufferImpl::initialize() in preparation for
an upstream change to WebGraphicsContext3D. The proper implementatation of the new initializer will be added once the upstream changes have landed. Also adding getPlatformTextureId() and prepareTexture() which will soon be defined in WebGraphicsContext3D. Review URL: http://codereview.chromium.org/2864021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc19
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.h9
2 files changed, 28 insertions, 0 deletions
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index c08ba7c..f6e6a2a 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -28,6 +28,14 @@ WebGraphicsContext3DCommandBufferImpl::
}
}
+// TODO(vangelis): Properly implement this method once the upstream WebKit
+// changes have landed.
+bool WebGraphicsContext3DCommandBufferImpl::initialize(
+ WebGraphicsContext3D::Attributes attributes,
+ WebKit::WebView*) {
+ return initialize(attributes);
+}
+
bool WebGraphicsContext3DCommandBufferImpl::initialize(
WebGraphicsContext3D::Attributes attributes) {
RenderThread* render_thread = RenderThread::current();
@@ -81,6 +89,17 @@ bool WebGraphicsContext3DCommandBufferImpl::isGLES2Compliant() {
return true;
}
+unsigned int WebGraphicsContext3DCommandBufferImpl::getPlatformTextureId() {
+ DCHECK(context_);
+ return ggl::GetParentTextureId(context_);
+}
+
+void WebGraphicsContext3DCommandBufferImpl::prepareTexture() {
+ // Copies the contents of the off-screen render target into the texture
+ // used by the compositor.
+ ggl::SwapBuffers(context_);
+}
+
void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) {
cached_width_ = width;
cached_height_ = height;
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
index 3ee751c..ad46606 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.h
@@ -13,6 +13,7 @@
#include "chrome/renderer/ggl/ggl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebGraphicsContext3D.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
#if !defined(OS_MACOSX)
#define FLIP_FRAMEBUFFER_VERTICALLY
@@ -38,7 +39,12 @@ class WebGraphicsContext3DCommandBufferImpl
//----------------------------------------------------------------------
// WebGraphicsContext3D methods
+ // TODO(vangelis): Remove this version of initialize() once the changes
+ // to WebGraphicsContext3D have been checked in upstream.
virtual bool initialize(WebGraphicsContext3D::Attributes attributes);
+ virtual bool initialize(WebGraphicsContext3D::Attributes attributes,
+ WebKit::WebView*);
+
virtual bool makeContextCurrent();
virtual int width();
@@ -52,6 +58,9 @@ class WebGraphicsContext3DCommandBufferImpl
virtual bool readBackFramebuffer(unsigned char* pixels, size_t buffer_size);
+ virtual unsigned int getPlatformTextureId();
+ virtual void prepareTexture();
+
virtual void activeTexture(unsigned long texture);
virtual void attachShader(WebGLId program, WebGLId shader);
virtual void bindAttribLocation(WebGLId program, unsigned long index,