diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-04 18:12:16 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-04 18:12:16 +0000 |
commit | 29ed96a41ff00d068e470c540fb9222f27239bc9 (patch) | |
tree | fe804f76d15a284d0a4a1f60aa7206cfc1d0eb21 /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | |
parent | cce3ab7135c7ace74e0c20caabc4f05e33e44085 (diff) | |
download | chromium_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.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index f76f622..5384b0f 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -347,7 +347,8 @@ int32_t PPB_Graphics2D_Impl::Flush(PP_CompletionCallback callback) { // We need the rect to be in terms of the current clip rect of the plugin // since that's what will actually be painted. If we issue an invalidate // for a clipped-out region, WebKit will do nothing and we won't get any - // ViewInitiatedPaint/ViewFlushedPaint calls, leaving our callback stranded. + // ViewWillInitiatePaint/ViewFlushedPaint calls, leaving our callback + // stranded. gfx::Rect visible_changed_rect; if (bound_instance_ && !op_rect.IsEmpty()) visible_changed_rect =PP_ToGfxRect(bound_instance_->view_data().clip_rect). @@ -560,7 +561,7 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas, #endif } -void PPB_Graphics2D_Impl::ViewInitiatedPaint() { +void PPB_Graphics2D_Impl::ViewWillInitiatePaint() { // Move any "unpainted" callback to the painted state. See // |unpainted_flush_callback_| in the header for more. if (!unpainted_flush_callback_.is_null()) { @@ -569,6 +570,9 @@ void PPB_Graphics2D_Impl::ViewInitiatedPaint() { } } +void PPB_Graphics2D_Impl::ViewInitiatedPaint() { +} + void PPB_Graphics2D_Impl::ViewFlushedPaint() { // Notify any "painted" callback. See |unpainted_flush_callback_| in the // header for more. |