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/thunk/thunk.h" | 5 #include "ppapi/thunk/thunk.h" |
6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
7 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 7 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
8 #include "ppapi/thunk/resource_creation_api.h" | 8 #include "ppapi/thunk/resource_creation_api.h" |
9 | 9 |
10 namespace ppapi { | 10 namespace ppapi { |
11 namespace thunk { | 11 namespace thunk { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; | 15 typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; |
16 | 16 |
17 PP_Graphics3DTrustedState GetErrorState() { | 17 PP_Graphics3DTrustedState GetErrorState() { |
18 PP_Graphics3DTrustedState error_state = { 0 }; | 18 PP_Graphics3DTrustedState error_state = { 0 }; |
19 error_state.error = PPB_GRAPHICS3D_TRUSTED_ERROR_GENERICERROR; | 19 error_state.error = PPB_GRAPHICS3D_TRUSTED_ERROR_GENERICERROR; |
20 return error_state; | 20 return error_state; |
21 } | 21 } |
22 | 22 |
23 PP_Resource CreateRaw(PP_Instance instance, | 23 PP_Resource CreateRaw(PP_Instance instance, |
24 PP_Resource share_context, | 24 PP_Resource share_context, |
25 const int32_t* attrib_list) { | 25 const int32_t* attrib_list) { |
26 EnterFunction<ResourceCreationAPI> enter(instance, true); | 26 EnterResourceCreation enter(instance); |
27 if (enter.failed()) | 27 if (enter.failed()) |
28 return 0; | 28 return 0; |
29 return enter.functions()->CreateGraphics3DRaw( | 29 return enter.functions()->CreateGraphics3DRaw( |
30 instance, share_context, attrib_list); | 30 instance, share_context, attrib_list); |
31 } | 31 } |
32 | 32 |
33 PP_Bool InitCommandBuffer(PP_Resource context) { | 33 PP_Bool InitCommandBuffer(PP_Resource context) { |
34 EnterGraphics3D enter(context, true); | 34 EnterGraphics3D enter(context, true); |
35 if (enter.failed()) | 35 if (enter.failed()) |
36 return PP_FALSE; | 36 return PP_FALSE; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 }; | 112 }; |
113 | 113 |
114 } // namespace | 114 } // namespace |
115 | 115 |
116 const PPB_Graphics3DTrusted_1_0* GetPPB_Graphics3DTrusted_1_0_Thunk() { | 116 const PPB_Graphics3DTrusted_1_0* GetPPB_Graphics3DTrusted_1_0_Thunk() { |
117 return &g_ppb_graphics_3d_trusted_thunk; | 117 return &g_ppb_graphics_3d_trusted_thunk; |
118 } | 118 } |
119 | 119 |
120 } // namespace thunk | 120 } // namespace thunk |
121 } // namespace ppapi | 121 } // namespace ppapi |
OLD | NEW |