summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 18:12:16 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 18:12:16 +0000
commit29ed96a41ff00d068e470c540fb9222f27239bc9 (patch)
treefe804f76d15a284d0a4a1f60aa7206cfc1d0eb21 /webkit/plugins/ppapi/ppb_graphics_2d_impl.h
parentcce3ab7135c7ace74e0c20caabc4f05e33e44085 (diff)
downloadchromium_src-29ed96a41ff00d068e470c540fb9222f27239bc9.zip
chromium_src-29ed96a41ff00d068e470c540fb9222f27239bc9.tar.gz
chromium_src-29ed96a41ff00d068e470c540fb9222f27239bc9.tar.bz2
Provide WillInitiatePaint() as well as DidInitiatePaint() and tweak semantics.
WillInitiatePaint() informs derived classes when the RenderWidget is about to perform a paint operation. DidInitiatePaint() informs derived classes that the RenderWidget has finished the paint operation and sent it to the browser to display. DidFlushPaint() informs derived classes when the paint operation has actually been displayed (either in response to UpdateRectAck, or OnSwapBuffersComplete()). Pepper Graphics2D uses WillInitiatePaint and DidFlushPaint to trigger its Flush callback only for flushes occurring after the paint has actually been initiated. Pepper Graphics3D uses DidInitiatePaint to know when the 3D pipeline is done with buffers from the previous paint operation, so that new content rendered to them won't be prematurely flushed to the screen. Known issues with this CL: * There is still scope for the Graphics2D to get confused when threaded compositing is in use, since DidFlushPaint for an older paint may be received after WillInitiatePaint for a more recent one, but that is a fix for another CL. * Graphics3D will now be notified earlier in than it would have been in the software case, since it previously hooked DidFlushPaint. BUG=111639 TEST=Run Native Client Examples "Pi generator", "Tumbler" and "Fullscreen Tumbler" with and without --force-composite-mode and verify they update correctly. Review URL: http://codereview.chromium.org/9328016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.h')
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_2d_impl.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
index bfe530d..80ad55a 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.h
@@ -64,9 +64,9 @@ class PPB_Graphics2D_Impl : public ::ppapi::Resource,
const gfx::Rect& plugin_rect,
const gfx::Rect& paint_rect);
- // Notifications that the view has rendered the page and that it has been
- // flushed to the screen. These messages are used to send Flush callbacks to
- // the plugin. See
+ // Notifications about the view's progress painting. See PluginInstance.
+ // These messages are used to send Flush callbacks to the plugin.
+ void ViewWillInitiatePaint();
void ViewInitiatedPaint();
void ViewFlushedPaint();
@@ -161,9 +161,10 @@ class PPB_Graphics2D_Impl : public ::ppapi::Resource,
// for which the ACK from the browser has not yet been received.
//
// When we get updates from a plugin with a callback, it is first added to
- // the unpainted callbacks. When the renderer has initiated a paint, we'll
- // move it to the painted callbacks list. When the renderer receives a flush,
- // we'll execute the callback and remove it from the list.
+ // the unpainted callbacks. When the renderer has initiated the paint, we move
+ // it to the painted callback. When the renderer receives a flush, we execute
+ // and clear the painted callback. This helps avoid the callback being called
+ // prematurely in response to flush notifications for a previous update.
FlushCallbackData unpainted_flush_callback_;
FlushCallbackData painted_flush_callback_;