From 6b2ebf86a61169856aa3e650c294fd3511da5ee3 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 16 Apr 2009 01:26:08 +0000 Subject: Fix a painting problem observed with windowless flash plugins, when they are initially created with a zero clip rect, which eventually changes to a non zero clip rect. We don't send over geometry updates to the plugin if the window dimensions don't change, which is true in this case. This causes the plugin process to not send over paints to the renderer process as the plugin clip rect remains zero. The fix based on a discussion with John is to remove the check for whether the plugin dimensions changed and always send over the update geometry IPC to the plugin, where we do check whether these rects changed before calling the underlying plugin. This fixes bug http://code.google.com/p/chromium/issues/detail?id=10536 I am trying to come up with a unit test for this case. Will add it to this CB or submit those as a separate CB. Bug=10536 Review URL: http://codereview.chromium.org/73071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13822 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webplugin_impl.cc | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'webkit/glue/webplugin_impl.cc') diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 195fb16..24748cc 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -133,12 +133,8 @@ bool WebPluginContainer::isPluginView() const { void WebPluginContainer::setFrameRect(const WebCore::IntRect& rect) { - bool widget_dimensions_changed = (rect != frameRect()); - - if (widget_dimensions_changed) - WebCore::Widget::setFrameRect(rect); - - impl_->setFrameRect(rect, widget_dimensions_changed); + WebCore::Widget::setFrameRect(rect); + impl_->setFrameRect(rect); } void WebPluginContainer::paint(WebCore::GraphicsContext* gc, @@ -198,7 +194,7 @@ void WebPluginContainer::frameRectsChanged() { WebCore::Widget::frameRectsChanged(); // This is a hack to tickle re-positioning of the plugin in the case where // our parent view was scrolled. - impl_->setFrameRect(frameRect(), true); + impl_->setFrameRect(frameRect()); } // We override this function, to make sure that geometry updates are sent @@ -221,7 +217,7 @@ void WebPluginContainer::setParentVisible(bool visible) { void WebPluginContainer::setParent(WebCore::ScrollView* view) { WebCore::Widget::setParent(view); if (view) { - impl_->setFrameRect(frameRect(), true); + impl_->setFrameRect(frameRect()); impl_->delegate_->FlushGeometryUpdates(); } } @@ -639,8 +635,7 @@ void WebPluginImpl::windowCutoutRects( } } -void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect, - bool widget_dimensions_changed) { +void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { if (!parent()) return; @@ -660,13 +655,8 @@ void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect, std::vector cutout_rects; CalculateBounds(rect, &window_rect, &clip_rect, &cutout_rects); - if (widget_dimensions_changed) { - // Notify the plugin that its parameters have changed. - delegate_->UpdateGeometry( - webkit_glue::FromIntRect(window_rect), - webkit_glue::FromIntRect(clip_rect)); - } - + delegate_->UpdateGeometry(webkit_glue::FromIntRect(window_rect), + webkit_glue::FromIntRect(clip_rect)); if (window_) { // Notify the window hosting the plugin (the WebViewDelegate) that // it needs to adjust the plugin, so that all the HWNDs can be moved -- cgit v1.1