summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.cc
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 22:49:59 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 22:49:59 +0000
commit2a6768655cd26d3834c79cbce5257e3aabb87eca (patch)
tree89483f152b94fb29bb38825063170b371f07a807 /chrome/renderer/webplugin_delegate_proxy.cc
parent2cee72cad9aa14ad897c3b2c52e700ae4c909afb (diff)
downloadchromium_src-2a6768655cd26d3834c79cbce5257e3aabb87eca.zip
chromium_src-2a6768655cd26d3834c79cbce5257e3aabb87eca.tar.gz
chromium_src-2a6768655cd26d3834c79cbce5257e3aabb87eca.tar.bz2
Ensure we aren't using stale invalidation rects for windowless plugins
Fixes two cases where message delays can cause the plugin painting system to use invalidation rects that are larger than the plugin is by the time they are handled. BUG=35328 TEST=See bug. Review URL: http://codereview.chromium.org/593063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38845 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index f4063e4..6747ef0 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -959,9 +959,14 @@ void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) {
if (!plugin_)
return;
+ // Clip the invalidation rect to the plugin bounds; the plugin may have been
+ // resized since the invalidate message was sent.
+ const gfx::Rect clipped_rect(rect.Intersect(
+ gfx::Rect(0, 0, plugin_rect_.width(), plugin_rect_.height())));
+
invalidate_pending_ = true;
- CopyFromTransportToBacking(rect);
- plugin_->InvalidateRect(rect);
+ CopyFromTransportToBacking(clipped_rect);
+ plugin_->InvalidateRect(clipped_rect);
}
void WebPluginDelegateProxy::OnGetWindowScriptNPObject(