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-03-18 17:30:52 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 17:30:52 +0000
commitee48d179fbf2376a62ff4d6b928f2725c088bf10 (patch)
tree3babdc2c85799f61753573c1196153cbcbfa647b /chrome/renderer/webplugin_delegate_proxy.cc
parent38364fd79c17db99541a7ed5fab9e8c253e76949 (diff)
downloadchromium_src-ee48d179fbf2376a62ff4d6b928f2725c088bf10.zip
chromium_src-ee48d179fbf2376a62ff4d6b928f2725c088bf10.tar.gz
chromium_src-ee48d179fbf2376a62ff4d6b928f2725c088bf10.tar.bz2
Fix the initial draw handing of Core Animation plugins
Removes the call to SetWindow(NULL) in the Core Animation case, since that causes the delegate to enable the TransportDIB drawing mode. Removes the early return in Paint, since now we don't call it (and if we do later, it'll be to get snapshots using the existing Cocoa event model path, per the ammended CA drawing model spec). Also renames windowless_ in WebPluginDelegateProxy to make it clear that it's just about drawing. BUG=37974 TEST=In a build with Core Animation plugin enabled, there should be no flash of black when the plugin is first drawn. Review URL: http://codereview.chromium.org/982010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index a400d39..daf58b5 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -157,7 +157,7 @@ WebPluginDelegateProxy::WebPluginDelegateProxy(
const base::WeakPtr<RenderView>& render_view)
: render_view_(render_view),
plugin_(NULL),
- windowless_(false),
+ uses_shared_bitmaps_(false),
window_(gfx::kNullPluginWindow),
mime_type_(mime_type),
instance_id_(MSG_ROUTING_NONE),
@@ -457,7 +457,7 @@ void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect,
param.ack_key = -1;
#endif
- if (windowless_) {
+ if (uses_shared_bitmaps_) {
if (!backing_store_canvas_.get() ||
(window_rect.width() != backing_store_canvas_->getDevice()->width() ||
window_rect.height() != backing_store_canvas_->getDevice()->height()))
@@ -623,8 +623,7 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
return;
}
- // No paint events for windowed plugins.
- if (!windowless_)
+ if (!uses_shared_bitmaps_)
return;
// We got a paint before the plugin's coordinates, so there's no buffer to
@@ -929,7 +928,7 @@ void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame,
#endif // OS_MACOSX
void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) {
- windowless_ = !window;
+ uses_shared_bitmaps_ = !window;
window_ = window;
if (plugin_)
plugin_->SetWindow(window);
@@ -1290,6 +1289,12 @@ bool WebPluginDelegateProxy::BindFakePluginWindowHandle() {
geom.rects_valid = true;
geom.visible = true;
render_view_->DidMovePlugin(geom);
+ // Invalidate the plugin region to ensure that the move event actually gets
+ // dispatched (for a plugin on an otherwise static page).
+ render_view_->didInvalidateRect(WebKit::WebRect(plugin_rect_.x(),
+ plugin_rect_.y(),
+ plugin_rect_.width(),
+ plugin_rect_.height()));
return true;
}