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

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

Issue 5835007: Revert 69511 - Make Graphics3D::SwapBuffers take a completion callback... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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_3d_impl.h ('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_graphics_3d_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_graphics_3d_impl.cc (revision 69511)
+++ webkit/plugins/ppapi/ppb_graphics_3d_impl.cc (working copy)
@@ -97,10 +97,10 @@
return current_context ? current_context->GetReference() : 0;
}
-PP_Bool SwapBuffers(PP_Resource graphics3d, PP_CompletionCallback callback) {
+PP_Bool SwapBuffers(PP_Resource graphics3d) {
scoped_refptr<PPB_Graphics3D_Impl> context(
Resource::GetAs<PPB_Graphics3D_Impl>(graphics3d));
- return BoolToPPBool(context && context->SwapBuffers(callback));
+ return BoolToPPBool(context && context->SwapBuffers());
}
uint32_t GetError() {
@@ -132,9 +132,7 @@
PPB_Graphics3D_Impl::PPB_Graphics3D_Impl(PluginModule* module)
: Resource(module),
- bound_instance_(NULL),
- swap_initiated_(false),
- swap_callback_(PP_BlockUntilComplete()) {
+ bound_instance_(NULL) {
}
const PPB_Graphics3D_Dev* PPB_Graphics3D_Impl::GetInterface() {
@@ -215,16 +213,10 @@
return true;
}
-bool PPB_Graphics3D_Impl::SwapBuffers(PP_CompletionCallback callback) {
+bool PPB_Graphics3D_Impl::SwapBuffers() {
if (!platform_context_.get())
return false;
- if (swap_callback_.func) {
- // Already a pending SwapBuffers that hasn't returned yet.
- return false;
- }
-
- swap_callback_ = callback;
return platform_context_->SwapBuffers();
}
@@ -249,26 +241,6 @@
platform_context_->SetSwapBuffersCallback(callback);
}
-void PPB_Graphics3D_Impl::ViewInitiatedPaint() {
- if (swap_callback_.func) {
- swap_initiated_ = true;
- }
-}
-
-void PPB_Graphics3D_Impl::ViewFlushedPaint() {
- // Notify any "painted" callback. See |unpainted_flush_callback_| in the
- // header for more.
- if (swap_initiated_ && swap_callback_.func) {
- // We must clear swap_callback_ before issuing the callback. It will be
- // common for the plugin to issue another SwapBuffers in response to the
- // callback, and we don't want to think that a callback is already pending.
- PP_CompletionCallback callback = PP_BlockUntilComplete();
- std::swap(callback, swap_callback_);
- swap_initiated_ = false;
- PP_RunCompletionCallback(&callback, PP_OK);
- }
-}
-
unsigned PPB_Graphics3D_Impl::GetBackingTextureId() {
if (!platform_context_.get())
return 0;
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_3d_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698