Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: webkit/plugins/ppapi/ppb_surface_3d_impl.cc

Issue 6625034: Clarify/fix fullscreen semantics, and add GetScreenSize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix review comments Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_surface_3d_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
index e79fcd7b7ebb8884824499a354feb7dd08b2084c..0c81c1a132b3ed8f02ab76146568d9ca8935d5a5 100644
--- a/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_surface_3d_impl.cc
@@ -144,9 +144,6 @@ int32_t PPB_Surface3D_Impl::SwapBuffers(PP_CompletionCallback callback) {
}
void PPB_Surface3D_Impl::ViewInitiatedPaint() {
- if (swap_callback_.func) {
- swap_initiated_ = true;
- }
}
void PPB_Surface3D_Impl::ViewFlushedPaint() {
@@ -166,8 +163,17 @@ unsigned int PPB_Surface3D_Impl::GetBackingTextureId() {
}
void PPB_Surface3D_Impl::OnSwapBuffers() {
- if (bound_to_instance_)
+ if (bound_to_instance_) {
instance()->CommitBackingTexture();
+ swap_initiated_ = true;
+ } else if (swap_callback_.func) {
+ // If we're off-screen, no need to trigger compositing so run the callback
+ // immediately.
+ PP_CompletionCallback callback = PP_BlockUntilComplete();
+ std::swap(callback, swap_callback_);
+ swap_initiated_ = false;
+ PP_RunCompletionCallback(&callback, PP_OK);
+ }
}
} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698