| 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 // From ppb_graphics_3d.idl modified Thu Oct 31 12:30:06 2013. | 5 // From ppb_graphics_3d.idl modified Fri Nov 1 16:12:12 2013. |
| 6 | 6 |
| 7 #include "ppapi/c/pp_completion_callback.h" | 7 #include "ppapi/c/pp_completion_callback.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/ppb_graphics_3d.h" | 9 #include "ppapi/c/ppb_graphics_3d.h" |
| 10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
| 11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
| 12 #include "ppapi/thunk/ppapi_thunk_export.h" | 12 #include "ppapi/thunk/ppapi_thunk_export.h" |
| 13 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 13 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
| 14 | 14 |
| 15 namespace ppapi { | 15 namespace ppapi { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 27 return enter.object()->GetAttribMaxValue(attribute, value); | 27 return enter.object()->GetAttribMaxValue(attribute, value); |
| 28 } | 28 } |
| 29 | 29 |
| 30 PP_Resource Create(PP_Instance instance, | 30 PP_Resource Create(PP_Instance instance, |
| 31 PP_Resource share_context, | 31 PP_Resource share_context, |
| 32 const int32_t attrib_list[]) { | 32 const int32_t attrib_list[]) { |
| 33 VLOG(4) << "PPB_Graphics3D::Create()"; | 33 VLOG(4) << "PPB_Graphics3D::Create()"; |
| 34 EnterResourceCreation enter(instance); | 34 EnterResourceCreation enter(instance); |
| 35 if (enter.failed()) | 35 if (enter.failed()) |
| 36 return 0; | 36 return 0; |
| 37 return enter.functions()->CreateGraphics3D(instance, | 37 return enter.functions()->CreateGraphics3D( |
| 38 share_context, | 38 instance, share_context, attrib_list); |
| 39 attrib_list); | |
| 40 } | 39 } |
| 41 | 40 |
| 42 PP_Bool IsGraphics3D(PP_Resource resource) { | 41 PP_Bool IsGraphics3D(PP_Resource resource) { |
| 43 VLOG(4) << "PPB_Graphics3D::IsGraphics3D()"; | 42 VLOG(4) << "PPB_Graphics3D::IsGraphics3D()"; |
| 44 EnterResource<PPB_Graphics3D_API> enter(resource, false); | 43 EnterResource<PPB_Graphics3D_API> enter(resource, false); |
| 45 return PP_FromBool(enter.succeeded()); | 44 return PP_FromBool(enter.succeeded()); |
| 46 } | 45 } |
| 47 | 46 |
| 48 int32_t GetAttribs(PP_Resource context, int32_t attrib_list[]) { | 47 int32_t GetAttribs(PP_Resource context, int32_t attrib_list[]) { |
| 49 VLOG(4) << "PPB_Graphics3D::GetAttribs()"; | 48 VLOG(4) << "PPB_Graphics3D::GetAttribs()"; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 | 78 |
| 80 int32_t SwapBuffers(PP_Resource context, | 79 int32_t SwapBuffers(PP_Resource context, |
| 81 struct PP_CompletionCallback callback) { | 80 struct PP_CompletionCallback callback) { |
| 82 VLOG(4) << "PPB_Graphics3D::SwapBuffers()"; | 81 VLOG(4) << "PPB_Graphics3D::SwapBuffers()"; |
| 83 EnterResource<PPB_Graphics3D_API> enter(context, callback, true); | 82 EnterResource<PPB_Graphics3D_API> enter(context, callback, true); |
| 84 if (enter.failed()) | 83 if (enter.failed()) |
| 85 return enter.retval(); | 84 return enter.retval(); |
| 86 return enter.SetResult(enter.object()->SwapBuffers(enter.callback())); | 85 return enter.SetResult(enter.object()->SwapBuffers(enter.callback())); |
| 87 } | 86 } |
| 88 | 87 |
| 89 const PPB_Graphics3D_1_0 g_ppb_graphics3d_thunk_1_0 = { | 88 const PPB_Graphics3D_1_0 g_ppb_graphics3d_thunk_1_0 = { // |
| 90 &GetAttribMaxValue, | 89 &GetAttribMaxValue, // |
| 91 &Create, | 90 &Create, // |
| 92 &IsGraphics3D, | 91 &IsGraphics3D, // |
| 93 &GetAttribs, | 92 &GetAttribs, // |
| 94 &SetAttribs, | 93 &SetAttribs, // |
| 95 &GetError, | 94 &GetError, // |
| 96 &ResizeBuffers, | 95 &ResizeBuffers, // |
| 97 &SwapBuffers | 96 &SwapBuffers // |
| 98 }; | 97 }; |
| 99 | 98 |
| 100 } // namespace | 99 } // namespace |
| 101 | 100 |
| 102 PPAPI_THUNK_EXPORT const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { | 101 PPAPI_THUNK_EXPORT const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { |
| 103 return &g_ppb_graphics3d_thunk_1_0; | 102 return &g_ppb_graphics3d_thunk_1_0; |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace thunk | 105 } // namespace thunk |
| 107 } // namespace ppapi | 106 } // namespace ppapi |
| OLD | NEW |