OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_Config3D_Dev config, | |
25 PP_Resource share_context, | 24 PP_Resource share_context, |
26 const int32_t* attrib_list) { | 25 const int32_t* attrib_list) { |
27 EnterFunction<ResourceCreationAPI> enter(instance, true); | 26 EnterFunction<ResourceCreationAPI> enter(instance, true); |
28 if (enter.failed()) | 27 if (enter.failed()) |
29 return 0; | 28 return 0; |
30 return enter.functions()->CreateGraphics3DRaw( | 29 return enter.functions()->CreateGraphics3DRaw( |
31 instance, config, share_context, attrib_list); | 30 instance, share_context, attrib_list); |
32 } | 31 } |
33 | 32 |
34 PP_Bool InitCommandBuffer(PP_Resource context, int32_t size) { | 33 PP_Bool InitCommandBuffer(PP_Resource context, int32_t size) { |
35 EnterGraphics3D enter(context, true); | 34 EnterGraphics3D enter(context, true); |
36 if (enter.failed()) | 35 if (enter.failed()) |
37 return PP_FALSE; | 36 return PP_FALSE; |
38 return enter.object()->InitCommandBuffer(size); | 37 return enter.object()->InitCommandBuffer(size); |
39 } | 38 } |
40 | 39 |
41 PP_Bool GetRingBuffer(PP_Resource context, | 40 PP_Bool GetRingBuffer(PP_Resource context, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 115 |
117 } // namespace | 116 } // namespace |
118 | 117 |
119 const PPB_Graphics3DTrusted_Dev* GetPPB_Graphics3DTrusted_Thunk() { | 118 const PPB_Graphics3DTrusted_Dev* GetPPB_Graphics3DTrusted_Thunk() { |
120 return &g_ppb_graphics_3d_trusted_thunk; | 119 return &g_ppb_graphics_3d_trusted_thunk; |
121 } | 120 } |
122 | 121 |
123 } // namespace thunk | 122 } // namespace thunk |
124 } // namespace ppapi | 123 } // namespace ppapi |
125 | 124 |
OLD | NEW |