Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm |
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
index 1ebce105ab25a9cb0571e41dde6dc3d375185d71..f947b046aae496add0562f5aa74702cc4aa2eb8a 100644 |
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
@@ -595,7 +595,8 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget) |
is_loading_(false), |
is_hidden_(false), |
shutdown_factory_(this), |
- needs_gpu_visibility_update_after_repaint_(false) { |
+ needs_gpu_visibility_update_after_repaint_(false), |
+ compositing_surface_(gfx::kNullPluginWindow) { |
// |cocoa_view_| owns us and we will be deleted when |cocoa_view_| goes away. |
// Since we autorelease it, our caller must put |native_view()| into the view |
// hierarchy right after calling us. |
@@ -931,6 +932,8 @@ void RenderWidgetHostViewMac::RenderViewGone(base::TerminationStatus status, |
} |
void RenderWidgetHostViewMac::Destroy() { |
+ // TODO(backer): Do we need to dealloc compositing_surface_? |
+ |
// On Windows, popups are implemented with a popup window style, so that when |
// an event comes in that would "cancel" it, it receives the OnCancelMode |
// message and can kill itself. Alas, on the Mac, views cannot capture events |
@@ -1297,13 +1300,11 @@ void RenderWidgetHostViewMac::GpuRenderingStateDidChange() { |
} |
} |
-gfx::PluginWindowHandle RenderWidgetHostViewMac::AcquireCompositingSurface() { |
- return AllocateFakePluginWindowHandle(/*opaque=*/true, /*root=*/true); |
-} |
- |
-void RenderWidgetHostViewMac::ReleaseCompositingSurface( |
- gfx::PluginWindowHandle surface) { |
- DestroyFakePluginWindowHandle(surface); |
+gfx::PluginWindowHandle RenderWidgetHostViewMac::GetCompositingSurface() { |
+ if (compositing_surface_ == gfx::kNullPluginWindow) |
+ compositing_surface_ = AllocateFakePluginWindowHandle( |
+ /*opaque=*/true, /*root=*/true); |
+ return compositing_surface_; |
} |
void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance( |