diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 23:57:50 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 23:57:50 +0000 |
commit | a3edf84415da5b5085364762f6ce0625ffd0b2d7 (patch) | |
tree | 10643a0da2fc96ca856c4dfe6eb41532a8a697a1 | |
parent | e390e92f0270823f947a3468c13c6e0817358aac (diff) | |
download | chromium_src-a3edf84415da5b5085364762f6ce0625ffd0b2d7.zip chromium_src-a3edf84415da5b5085364762f6ce0625ffd0b2d7.tar.gz chromium_src-a3edf84415da5b5085364762f6ce0625ffd0b2d7.tar.bz2 |
Fix offscren invalidation in windowless plugins
Fixes two related issues:
- An invalidate that was entirely off screen, but for a plugin that was partial on-screen, would not trigger a paint when the damaged area was scrolled back into view (all platforms).
- When a Mac plugin's container became visible, damaged regions were not repainted (Mac only).
BUG=41383
TEST=See bug.
Review URL: http://codereview.chromium.org/1629018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44582 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 6 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 2dfc7a2..c3654e8 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -130,8 +130,8 @@ void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { // This is not true because scrolling (or window resize) could occur and be // handled by the renderer before it receives the InvalidateRect message, // changing the clip rect and then not painting. - if (invalidate_rect.IsEmpty() || - !delegate_->GetClipRect().Intersects(invalidate_rect)) + if (damaged_rect_.IsEmpty() || + !delegate_->GetClipRect().Intersects(damaged_rect_)) return; // Only send a single InvalidateRect message at a time. From DidPaint we @@ -457,7 +457,7 @@ void WebPluginProxy::UpdateGeometry( // Send over any pending invalidates which occured when the plugin was // off screen. if (delegate_->IsWindowless() && !clip_rect.IsEmpty() && - old_clip_rect.IsEmpty() && !damaged_rect_.IsEmpty()) { + !damaged_rect_.IsEmpty()) { InvalidateRect(damaged_rect_); } diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 7f33a52..a2ee61d 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -688,6 +688,13 @@ void WebPluginDelegateImpl::SetContainerVisibility(bool is_visible) { PluginVisibilityChanged(); WindowlessSetWindow(true); } + + // When the plugin become visible, send an empty invalidate. If there were any + // pending invalidations this will trigger a paint event for the damaged + // region, and if not it's a no-op. This is necessary since higher levels + // that would normally do this weren't responsible for the clip_rect_ change). + if (!clip_rect_.IsEmpty()) + instance()->webplugin()->InvalidateRect(gfx::Rect()); } // Update the size of the IOSurface to match the current size of the plug-in, |