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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

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
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 89234675f771c14a2a78298122ff9802c4f1240b..36f393c82d3ccd0d1b4223088d3c0d36d4cabc07 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -846,6 +846,30 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped(
[view setSurfaceWasSwapped:YES];
}
+void RenderWidgetHostViewMac::GpuRenderingStateDidChange() {
+ // Plugins are destroyed on page navigate. The compositor layer on the other
+ // hand is created on demand and then stays alive until its renderer process
+ // dies (usually on cross-domain navigation). Instead, only a flag
+ // |is_gpu_rendering_active()| is flipped when the compositor output should be
+ // shown/hidden.
+ // Show/hide the view belonging to the compositor here.
+ plugin_container_manager_.set_gpu_rendering_active(
+ GetRenderWidgetHost()->is_gpu_rendering_active());
+
+ gfx::PluginWindowHandle root_handle =
+ plugin_container_manager_.root_container_handle();
+ if (root_handle != gfx::kNullPluginWindow) {
+ PluginViewMap::iterator it = plugin_views_.find(root_handle);
+ DCHECK(plugin_views_.end() != it);
+ if (plugin_views_.end() == it) {
+ return;
+ }
+ bool visible =
+ plugin_container_manager_.SurfaceShouldBeVisible(root_handle);
+ [it->second setHidden:!visible];
+ }
+}
+
void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance(
CGLContextObj context, gfx::PluginWindowHandle plugin_handle) {
// Called on the display link thread.
@@ -866,10 +890,7 @@ void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance(
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- plugin_container_manager_.Draw(
- context,
- plugin_handle,
- GetRenderWidgetHost()->is_gpu_rendering_active());
+ plugin_container_manager_.Draw(context, plugin_handle);
}
void RenderWidgetHostViewMac::ForceTextureReload() {
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_mac.h ('k') | chrome/browser/renderer_host/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698