summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/plugin/webplugin_proxy.cc6
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm7
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,