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/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" |
11 | 11 |
12 namespace ppapi { | 12 namespace ppapi { |
13 namespace thunk { | 13 namespace thunk { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; | 17 typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; |
18 | 18 |
19 int32_t GetAttribMaxValue(PP_Resource instance, | 19 int32_t GetAttribMaxValue(PP_Resource instance, |
20 int32_t attribute, | 20 int32_t attribute, |
21 int32_t* value) { | 21 int32_t* value) { |
22 // TODO(alokp): Implement me. | 22 // TODO(alokp): Implement me. |
23 return PP_ERROR_FAILED; | 23 return PP_ERROR_FAILED; |
24 } | 24 } |
25 | 25 |
26 PP_Resource Create(PP_Instance instance, | 26 PP_Resource Create(PP_Instance instance, |
27 PP_Resource share_context, | 27 PP_Resource share_context, |
28 const int32_t* attrib_list) { | 28 const int32_t attrib_list[]) { |
29 EnterResourceCreation enter(instance); | 29 EnterResourceCreation enter(instance); |
30 if (enter.failed()) | 30 if (enter.failed()) |
31 return 0; | 31 return 0; |
32 return enter.functions()->CreateGraphics3D( | 32 return enter.functions()->CreateGraphics3D( |
33 instance, share_context, attrib_list); | 33 instance, share_context, attrib_list); |
34 } | 34 } |
35 | 35 |
36 PP_Bool IsGraphics3D(PP_Resource resource) { | 36 PP_Bool IsGraphics3D(PP_Resource resource) { |
37 EnterGraphics3D enter(resource, false); | 37 EnterGraphics3D enter(resource, false); |
38 return PP_FromBool(enter.succeeded()); | 38 return PP_FromBool(enter.succeeded()); |
39 } | 39 } |
40 | 40 |
41 int32_t GetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) { | 41 int32_t GetAttribs(PP_Resource graphics_3d, int32_t attrib_list[]) { |
42 EnterGraphics3D enter(graphics_3d, true); | 42 EnterGraphics3D enter(graphics_3d, true); |
43 if (enter.failed()) | 43 if (enter.failed()) |
44 return enter.retval(); | 44 return enter.retval(); |
45 return enter.object()->GetAttribs(attrib_list); | 45 return enter.object()->GetAttribs(attrib_list); |
46 } | 46 } |
47 | 47 |
48 int32_t SetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) { | 48 int32_t SetAttribs(PP_Resource graphics_3d, const int32_t attrib_list[]) { |
49 EnterGraphics3D enter(graphics_3d, true); | 49 EnterGraphics3D enter(graphics_3d, true); |
50 if (enter.failed()) | 50 if (enter.failed()) |
51 return enter.retval(); | 51 return enter.retval(); |
52 return enter.object()->SetAttribs(attrib_list); | 52 return enter.object()->SetAttribs(attrib_list); |
53 } | 53 } |
54 | 54 |
55 int32_t GetError(PP_Resource graphics_3d) { | 55 int32_t GetError(PP_Resource graphics_3d) { |
56 EnterGraphics3D enter(graphics_3d, true); | 56 EnterGraphics3D enter(graphics_3d, true); |
57 if (enter.failed()) | 57 if (enter.failed()) |
58 return enter.retval(); | 58 return enter.retval(); |
(...skipping 26 matching lines...) Expand all Loading... |
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 |
OLD | NEW |