From 69b791279a6108b4064b5d5b9faccd0f64a620d7 Mon Sep 17 00:00:00 2001 From: "alexst@chromium.org" Date: Thu, 14 Feb 2013 19:16:45 +0000 Subject: Fix visibility in compositing. When visibility of the browser plugin is toggled on and off, the image remained on screen in the compositing mode. This was introduced by the gutter layer used during resizing and autosize. The gutter layer is the compositing layer used for the browser plugin container. The content layer with the actual texture is the child of that gutter layer. When the container visibility is toggled, only the gutter layer was hidden. The solution is to plumb visibility changed to the compositing helper and hide the texture layer manually. BUG=175752 Review URL: https://chromiumcodereview.appspot.com/12258026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182505 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/browser_plugin/browser_plugin.cc | 3 +++ content/renderer/browser_plugin/browser_plugin_compositing_helper.cc | 5 +++++ content/renderer/browser_plugin/browser_plugin_compositing_helper.h | 1 + 3 files changed, 9 insertions(+) (limited to 'content') diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 99747c6..47de906 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -1102,6 +1102,9 @@ void BrowserPlugin::updateVisibility(bool visible) { if (!navigate_src_sent_) return; + if (compositing_helper_) + compositing_helper_->UpdateVisibility(visible); + browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetVisibility( render_view_routing_id_, instance_id_, diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc index 63fc12e..e056618 100644 --- a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc +++ b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc @@ -210,4 +210,9 @@ void BrowserPluginCompositingHelper::OnBuffersSwapped( last_mailbox_valid_ = current_mailbox_valid; } +void BrowserPluginCompositingHelper::UpdateVisibility(bool visible) { + if (texture_layer_) + texture_layer_->setIsDrawable(visible); +} + } // namespace content diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_helper.h b/content/renderer/browser_plugin/browser_plugin_compositing_helper.h index 9f739f4..a11956d 100644 --- a/content/renderer/browser_plugin/browser_plugin_compositing_helper.h +++ b/content/renderer/browser_plugin/browser_plugin_compositing_helper.h @@ -39,6 +39,7 @@ class CONTENT_EXPORT BrowserPluginCompositingHelper : const std::string& mailbox_name, int gpu_route_id, int gpu_host_id); + void UpdateVisibility(bool); protected: // Friend RefCounted so that the dtor can be non-public. friend class base::RefCounted; -- cgit v1.1