summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 00:49:57 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 00:49:57 +0000
commita87078352ef50bf6ea9ebc3598a7d23c17e69817 (patch)
tree75a46c66893610bd84e7c4dd387069dc8ac3df0c /webkit/plugins
parent5999c5a8d124d48c346cdaae12ef8a7128f6cab6 (diff)
downloadchromium_src-a87078352ef50bf6ea9ebc3598a7d23c17e69817.zip
chromium_src-a87078352ef50bf6ea9ebc3598a7d23c17e69817.tar.gz
chromium_src-a87078352ef50bf6ea9ebc3598a7d23c17e69817.tar.bz2
Make Pepper resize the buffer through the command buffer.
This adds support for glResizeCHROMIUM for off-screen contexts. BUG=none TEST=Pepper flash. Review URL: http://codereview.chromium.org/6241015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h3
-rw-r--r--webkit/plugins/ppapi/ppb_surface_3d_impl.cc13
2 files changed, 4 insertions, 12 deletions
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index 1a94ea0..869189b 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -151,9 +151,6 @@ class PluginDelegate {
// Get the last EGL error.
virtual unsigned GetError() = 0;
- // Resize the backing texture used as a back buffer by OpenGL.
- virtual void ResizeBackingTexture(const gfx::Size& size) = 0;
-
// Set an optional callback that will be invoked when the side effects of
// a SwapBuffers call become visible to the compositor. Takes ownership
// of the callback.
diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
index ab37013..6603abf 100644
--- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
@@ -4,6 +4,7 @@
#include "webkit/plugins/ppapi/ppb_surface_3d_impl.h"
+#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "ppapi/c/dev/ppb_graphics_3d_dev.h"
#include "webkit/plugins/ppapi/common.h"
@@ -105,15 +106,9 @@ bool PPB_Surface3D_Impl::BindToContext(
if (context) {
// Resize the backing texture to the size of the instance when it is bound.
// TODO(alokp): This should be the responsibility of plugins.
- context->ResizeBackingTexture(instance()->position().size());
-
- // This is a temporary hack. The SwapBuffers is issued to force the resize
- // to take place before any subsequent rendering. This might lead to a
- // partially rendered frame being displayed. It is also not thread safe
- // since the SwapBuffers is written to the command buffer and that command
- // buffer might be written to by another thread.
- // TODO(apatrick): Figure out the semantics of binding and resizing.
- context->SwapBuffers();
+ const gfx::Size& size = instance()->position().size();
+ context->GetGLES2Implementation()->ResizeCHROMIUM(
+ size.width(), size.height());
context->SetSwapBuffersCallback(
NewCallback(this, &PPB_Surface3D_Impl::OnSwapBuffers));