diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 22:08:35 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 22:08:35 +0000 |
commit | 0c860d067e62556bad67620240abc9abfeb85c7d (patch) | |
tree | 6d0c6d8cc5d302a5b2fffeb4ffc6b1a160b52d59 /webkit/glue/plugins/webplugin_impl.cc | |
parent | 567dae2f920dbc1bdaf6d9defda0253b833f305b (diff) | |
download | chromium_src-0c860d067e62556bad67620240abc9abfeb85c7d.zip chromium_src-0c860d067e62556bad67620240abc9abfeb85c7d.tar.gz chromium_src-0c860d067e62556bad67620240abc9abfeb85c7d.tar.bz2 |
At times the Windows media player plugin would not render video. This would occur if it initially
received a geometry update of size 0. The plugin has a bug where it ignores subsequent geometry updates.
Based on the webkit plugin implementation they have a quirk which handles this case for media player and divx.
To ensure that this quirk works correctly in cases where we only receive one geometry update we send out
geometry updates during paint as well if needed.
Fix is to mimic this behavior for Chromium.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=43916
Bug=43916
Review URL: http://codereview.chromium.org/2752009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/webplugin_impl.cc')
-rw-r--r-- | webkit/glue/plugins/webplugin_impl.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/webkit/glue/plugins/webplugin_impl.cc b/webkit/glue/plugins/webplugin_impl.cc index c4b9434..a83f35c 100644 --- a/webkit/glue/plugins/webplugin_impl.cc +++ b/webkit/glue/plugins/webplugin_impl.cc @@ -240,9 +240,15 @@ NPObject* WebPluginImpl::scriptableObject() { } void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& paint_rect) { - if (!delegate_) + if (!delegate_ || !container_) return; +#if defined(OS_WIN) + // Force a geometry update if needed to allow plugins like media player + // which defer the initial geometry update to work. + container_->reportGeometry(); +#endif // OS_WIN + // Note that |canvas| is only used when in windowless mode. delegate_->Paint(canvas, paint_rect); } @@ -291,8 +297,21 @@ void WebPluginImpl::updateGeometry( } } - first_geometry_update_ = false; +#if defined(OS_WIN) + // Don't cache the geometry during the first geometry update. The first + // geometry update sequence is received when Widget::setParent is called. + // For plugins like media player which have a bug where they only honor + // the first geometry update, we have a quirk which ignores the first + // geometry update. To ensure that these plugins work correctly in cases + // where we receive only one geometry update from webkit, we also force + // a geometry update during paint which should go out correctly as the + // initial geometry update was not cached. + if (!first_geometry_update_) + geometry_ = new_geometry; +#else // OS_WIN geometry_ = new_geometry; +#endif // OS_WIN + first_geometry_update_ = false; } void WebPluginImpl::updateFocus(bool focused) { |