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" |
(...skipping 11 matching lines...) Expand all Loading... |
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 |
| 33 PPB_Graphics3D_API* share_api = NULL; |
| 34 if (share_context) { |
| 35 EnterResourceNoLock<PPB_Graphics3D_API> enter_share(instance, true); |
| 36 if (enter_share.failed()) |
| 37 return 0; |
| 38 share_api = enter_share.object(); |
| 39 } |
| 40 |
32 return enter.functions()->CreateGraphics3D( | 41 return enter.functions()->CreateGraphics3D( |
33 instance, share_context, attrib_list); | 42 instance, share_api, attrib_list); |
34 } | 43 } |
35 | 44 |
36 PP_Bool IsGraphics3D(PP_Resource resource) { | 45 PP_Bool IsGraphics3D(PP_Resource resource) { |
37 EnterGraphics3D enter(resource, false); | 46 EnterGraphics3D enter(resource, false); |
38 return PP_FromBool(enter.succeeded()); | 47 return PP_FromBool(enter.succeeded()); |
39 } | 48 } |
40 | 49 |
41 int32_t GetAttribs(PP_Resource graphics_3d, int32_t attrib_list[]) { | 50 int32_t GetAttribs(PP_Resource graphics_3d, int32_t attrib_list[]) { |
42 EnterGraphics3D enter(graphics_3d, true); | 51 EnterGraphics3D enter(graphics_3d, true); |
43 if (enter.failed()) | 52 if (enter.failed()) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 }; | 94 }; |
86 | 95 |
87 } // namespace | 96 } // namespace |
88 | 97 |
89 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { | 98 const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { |
90 return &g_ppb_graphics_3d_thunk; | 99 return &g_ppb_graphics_3d_thunk; |
91 } | 100 } |
92 | 101 |
93 } // namespace thunk | 102 } // namespace thunk |
94 } // namespace ppapi | 103 } // namespace ppapi |
OLD | NEW |