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

Side by Side Diff: ppapi/thunk/ppb_graphics_3d_thunk.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated TestURLLoader to test blocking callbacks. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/c/pp_completion_callback.h" 5 #include "ppapi/c/pp_completion_callback.h"
6 #include "ppapi/c/pp_errors.h" 6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/thunk/enter.h" 7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/thunk.h" 8 #include "ppapi/thunk/thunk.h"
9 #include "ppapi/thunk/ppb_graphics_3d_api.h" 9 #include "ppapi/thunk/ppb_graphics_3d_api.h"
10 #include "ppapi/thunk/resource_creation_api.h" 10 #include "ppapi/thunk/resource_creation_api.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 EnterGraphics3D enter(graphics_3d, true); 63 EnterGraphics3D enter(graphics_3d, true);
64 if (enter.failed()) 64 if (enter.failed())
65 return enter.retval(); 65 return enter.retval();
66 return enter.object()->ResizeBuffers(width, height); 66 return enter.object()->ResizeBuffers(width, height);
67 } 67 }
68 68
69 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { 69 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) {
70 EnterGraphics3D enter(graphics_3d, callback, true); 70 EnterGraphics3D enter(graphics_3d, callback, true);
71 if (enter.failed()) 71 if (enter.failed())
72 return enter.retval(); 72 return enter.retval();
73 return enter.SetResult(enter.object()->SwapBuffers(callback)); 73 return enter.SetResult(enter.object()->SwapBuffers(enter.callback()));
74 } 74 }
75 75
76 const PPB_Graphics3D g_ppb_graphics_3d_thunk = { 76 const PPB_Graphics3D g_ppb_graphics_3d_thunk = {
77 &GetAttribMaxValue, 77 &GetAttribMaxValue,
78 &Create, 78 &Create,
79 &IsGraphics3D, 79 &IsGraphics3D,
80 &GetAttribs, 80 &GetAttribs,
81 &SetAttribs, 81 &SetAttribs,
82 &GetError, 82 &GetError,
83 &ResizeBuffers, 83 &ResizeBuffers,
84 &SwapBuffers 84 &SwapBuffers
85 }; 85 };
86 86
87 } // namespace 87 } // namespace
88 88
89 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { 89 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() {
90 return &g_ppb_graphics_3d_thunk; 90 return &g_ppb_graphics_3d_thunk;
91 } 91 }
92 92
93 } // namespace thunk 93 } // namespace thunk
94 } // namespace ppapi 94 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698