OLD | NEW |
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/shared_impl/tracked_callback.h" |
7 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/thunk.h" | 9 #include "ppapi/thunk/thunk.h" |
9 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 10 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 11 #include "ppapi/thunk/resource_creation_api.h" |
11 | 12 |
12 namespace ppapi { | 13 namespace ppapi { |
13 namespace thunk { | 14 namespace thunk { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 EnterGraphics3D enter(graphics_3d, true); | 64 EnterGraphics3D enter(graphics_3d, true); |
64 if (enter.failed()) | 65 if (enter.failed()) |
65 return enter.retval(); | 66 return enter.retval(); |
66 return enter.object()->ResizeBuffers(width, height); | 67 return enter.object()->ResizeBuffers(width, height); |
67 } | 68 } |
68 | 69 |
69 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { | 70 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { |
70 EnterGraphics3D enter(graphics_3d, callback, true); | 71 EnterGraphics3D enter(graphics_3d, callback, true); |
71 if (enter.failed()) | 72 if (enter.failed()) |
72 return enter.retval(); | 73 return enter.retval(); |
73 return enter.SetResult(enter.object()->SwapBuffers(callback)); | 74 return enter.SetResult(enter.object()->SwapBuffers(enter.callback())); |
74 } | 75 } |
75 | 76 |
76 const PPB_Graphics3D g_ppb_graphics_3d_thunk = { | 77 const PPB_Graphics3D g_ppb_graphics_3d_thunk = { |
77 &GetAttribMaxValue, | 78 &GetAttribMaxValue, |
78 &Create, | 79 &Create, |
79 &IsGraphics3D, | 80 &IsGraphics3D, |
80 &GetAttribs, | 81 &GetAttribs, |
81 &SetAttribs, | 82 &SetAttribs, |
82 &GetError, | 83 &GetError, |
83 &ResizeBuffers, | 84 &ResizeBuffers, |
84 &SwapBuffers | 85 &SwapBuffers |
85 }; | 86 }; |
86 | 87 |
87 } // namespace | 88 } // namespace |
88 | 89 |
89 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { | 90 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { |
90 return &g_ppb_graphics_3d_thunk; | 91 return &g_ppb_graphics_3d_thunk; |
91 } | 92 } |
92 | 93 |
93 } // namespace thunk | 94 } // namespace thunk |
94 } // namespace ppapi | 95 } // namespace ppapi |
OLD | NEW |