diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 02:54:40 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 02:54:40 +0000 |
commit | ebebd706bf470fc11f7ffba25b791e2548d82b87 (patch) | |
tree | bc4a337a92f89e9aaf567b36e76294f0d0a6bb31 /chrome/renderer | |
parent | ae38d9b2534e59b7920d5a5952a578673f199304 (diff) | |
download | chromium_src-ebebd706bf470fc11f7ffba25b791e2548d82b87.zip chromium_src-ebebd706bf470fc11f7ffba25b791e2548d82b87.tar.gz chromium_src-ebebd706bf470fc11f7ffba25b791e2548d82b87.tar.bz2 |
Mac: Correctly show/hide compositor on navigations.
The problem was that unlike plugins, the compositor surface is not destroyed on navigation, only a variable is_gpu_rendering_active is updated. The fix is to tell the RenderWidgetHostView if this variable changed and then to adapt the visibility of the view rendering the compositing layer accordingly.
Also, destroy its AcceleratedSurfaceContainer when the compositor is destroyed.
BUG=52134,51748
TEST=go to http://webkit.org/blog/386/3d-transforms/, then hit back. page should redraw on back button. go forward, should work too.
Review URL: http://codereview.chromium.org/3132038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/webgles2context_impl.cc | 20 | ||||
-rw-r--r-- | chrome/renderer/webgles2context_impl.h | 8 |
2 files changed, 25 insertions, 3 deletions
diff --git a/chrome/renderer/webgles2context_impl.cc b/chrome/renderer/webgles2context_impl.cc index d0e35d7..b4241e1 100644 --- a/chrome/renderer/webgles2context_impl.cc +++ b/chrome/renderer/webgles2context_impl.cc @@ -12,7 +12,13 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -WebGLES2ContextImpl::WebGLES2ContextImpl() : context_(NULL) { +WebGLES2ContextImpl::WebGLES2ContextImpl() + : context_(NULL) +#if defined(OS_MACOSX) + , plugin_handle_(gfx::kNullPluginWindow) + , web_view_(NULL) +#endif + { } WebGLES2ContextImpl::~WebGLES2ContextImpl() { @@ -49,8 +55,9 @@ bool WebGLES2ContextImpl::initialize( #if !defined(OS_MACOSX) view_id = renderview->host_window(); #else - view_id = static_cast<gfx::NativeViewId>( - renderview->AllocateFakePluginWindowHandle(true, true)); + plugin_handle_ = renderview->AllocateFakePluginWindowHandle(true, true); + web_view_ = web_view; + view_id = static_cast<gfx::NativeViewId>(plugin_handle_); #endif context_ = ggl::CreateViewContext( host, view_id, @@ -76,6 +83,13 @@ bool WebGLES2ContextImpl::makeCurrent() { } bool WebGLES2ContextImpl::destroy() { +#if defined(OS_MACOSX) + RenderView* renderview = RenderView::FromWebView(web_view_); + DCHECK(plugin_handle_ == gfx::kNullPluginWindow || renderview); + if (plugin_handle_ != gfx::kNullPluginWindow && renderview) + renderview->DestroyFakePluginWindowHandle(plugin_handle_); + plugin_handle_ = gfx::kNullPluginWindow; +#endif return ggl::DestroyContext(context_); } diff --git a/chrome/renderer/webgles2context_impl.h b/chrome/renderer/webgles2context_impl.h index e8c267e..d77313b 100644 --- a/chrome/renderer/webgles2context_impl.h +++ b/chrome/renderer/webgles2context_impl.h @@ -12,6 +12,10 @@ #include "third_party/WebKit/WebKit/chromium/public/WebGLES2Context.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" +#if defined(OS_MACOSX) +#include "gfx/native_widget_types.h" +#endif + class WebGLES2ContextImpl : public WebKit::WebGLES2Context { public: WebGLES2ContextImpl(); @@ -36,7 +40,11 @@ class WebGLES2ContextImpl : public WebKit::WebGLES2Context { private: // The GGL context we use for OpenGL rendering. ggl::Context* context_; + +#if defined(OS_MACOSX) + gfx::PluginWindowHandle plugin_handle_; WebKit::WebView* web_view_; +#endif }; #endif // defined(ENABLE_GPU) |