From a87078352ef50bf6ea9ebc3598a7d23c17e69817 Mon Sep 17 00:00:00 2001 From: "piman@google.com" Date: Wed, 26 Jan 2011 00:49:57 +0000 Subject: 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 --- webkit/plugins/ppapi/plugin_delegate.h | 3 --- webkit/plugins/ppapi/ppb_surface_3d_impl.cc | 13 ++++--------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'webkit/plugins') 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)); -- cgit v1.1