diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-11 19:23:05 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-11 19:23:05 +0000 |
commit | e14774c883a1bda8609bc1ea21e85c1fbe44c5d6 (patch) | |
tree | 0d9efaef946244a7b9e7e0ee6881dc5005381eda /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | |
parent | 8445ced57bf8ec7de24558aa077d9c7f54a51f92 (diff) | |
download | chromium_src-e14774c883a1bda8609bc1ea21e85c1fbe44c5d6.zip chromium_src-e14774c883a1bda8609bc1ea21e85c1fbe44c5d6.tar.gz chromium_src-e14774c883a1bda8609bc1ea21e85c1fbe44c5d6.tar.bz2 |
Remove incorrect optimization for plugin binding. This would cause incorrect
invalidations when changing the bound graphics 2d of an instance.
The optimization is also no longer important since the new paint manager
will do the opposite of what the comment for the optimization was saying. The
paint manager now has plugins paint into the offscreen bitmap and then flush
the completed new image data to the instance all at once.
The sequence of operations that causes the problem is to bind a device and
paint it (order unimportant). Then bind a new fresh one at a smaller size,
and then paint it. Because of this optimization, the second bind wouldn't
invalidate, and then the subsequent paints to it would not invalidate outside
of the bounds of the new Graphics2D.
BUG=81475
Review URL: http://codereview.chromium.org/7326022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92036 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index f6294449..77da1e2 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -154,7 +154,6 @@ struct PPB_Graphics2D_Impl::QueuedOperation { PPB_Graphics2D_Impl::PPB_Graphics2D_Impl(PluginInstance* instance) : Resource(instance), bound_instance_(NULL), - flushed_any_data_(false), offscreen_flush_pending_(false), is_always_opaque_(false) { } @@ -340,7 +339,6 @@ int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) { } } queued_operations_.clear(); - flushed_any_data_ = true; if (nothing_visible) { // There's nothing visible to invalidate so just schedule the callback to @@ -423,15 +421,8 @@ bool PPB_Graphics2D_Impl::BindToInstance(PluginInstance* new_instance) { std::swap(callback, painted_flush_callback_); ScheduleOffscreenCallback(callback); } - } else if (flushed_any_data_) { - // Only schedule a paint if this backing store has had any data flushed to - // it. This is an optimization. A "normal" plugin will first allocated a - // backing store, bind it, and then execute their normal painting and - // update loop. If binding a device always invalidated, it would mean we - // would get one paint for the bind, and one for the first time the plugin - // actually painted something. By not bothering to schedule an invalidate - // when an empty device is initially bound, we can save an extra paint for - // many plugins during the critical page initialization phase. + } else { + // Devices being replaced, redraw the plugin. new_instance->InvalidateRect(gfx::Rect()); } |