Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Unified Diff: chrome/renderer/webgles2context_impl.cc

Issue 3132038: Mac: Correctly show/hide compositor on navigations. (Closed)
Patch Set: comment Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/webgles2context_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webgles2context_impl.cc
diff --git a/chrome/renderer/webgles2context_impl.cc b/chrome/renderer/webgles2context_impl.cc
index d0e35d7c4974ff8a24943516938f7bf181332c53..b4241e117fbb575e001fdd6e147f89ba64733068 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_);
}
« no previous file with comments | « chrome/renderer/webgles2context_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698