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/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/common.h" | 7 #include "ppapi/thunk/common.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/thunk.h" | 9 #include "ppapi/thunk/thunk.h" |
10 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 10 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return enter.object()->GetAttribs(attrib_list); | 57 return enter.object()->GetAttribs(attrib_list); |
58 } | 58 } |
59 | 59 |
60 int32_t SetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) { | 60 int32_t SetAttribs(PP_Resource graphics_3d, int32_t* attrib_list) { |
61 EnterGraphics3D enter(graphics_3d, true); | 61 EnterGraphics3D enter(graphics_3d, true); |
62 if (enter.failed()) | 62 if (enter.failed()) |
63 return PP_ERROR_BADRESOURCE; | 63 return PP_ERROR_BADRESOURCE; |
64 return enter.object()->SetAttribs(attrib_list); | 64 return enter.object()->SetAttribs(attrib_list); |
65 } | 65 } |
66 | 66 |
| 67 int32_t Resize(PP_Resource graphics_3d, int32_t width, int32_t height) { |
| 68 EnterGraphics3D enter(graphics_3d, true); |
| 69 if (enter.failed()) |
| 70 return PP_ERROR_BADRESOURCE; |
| 71 return enter.object()->Resize(width, height); |
| 72 } |
| 73 |
67 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { | 74 int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { |
68 EnterGraphics3D enter(graphics_3d, true); | 75 EnterGraphics3D enter(graphics_3d, true); |
69 if (enter.failed()) | 76 if (enter.failed()) |
70 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); | 77 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); |
71 int32_t result = enter.object()->SwapBuffers(callback); | 78 int32_t result = enter.object()->SwapBuffers(callback); |
72 return MayForceCallback(callback, result); | 79 return MayForceCallback(callback, result); |
73 } | 80 } |
74 | 81 |
75 const PPB_Graphics3D_Dev g_ppb_graphics_3d_thunk = { | 82 const PPB_Graphics3D_Dev g_ppb_graphics_3d_thunk = { |
76 &GetConfigs, | 83 &GetConfigs, |
77 &GetConfigAttribs, | 84 &GetConfigAttribs, |
78 &GetString, | 85 &GetString, |
79 &Create, | 86 &Create, |
80 &IsGraphics3D, | 87 &IsGraphics3D, |
81 &GetAttribs, | 88 &GetAttribs, |
82 &SetAttribs, | 89 &SetAttribs, |
| 90 &Resize, |
83 &SwapBuffers | 91 &SwapBuffers |
84 }; | 92 }; |
85 | 93 |
86 } // namespace | 94 } // namespace |
87 | 95 |
88 const PPB_Graphics3D_Dev* GetPPB_Graphics3D_Thunk() { | 96 const PPB_Graphics3D_Dev* GetPPB_Graphics3D_Thunk() { |
89 return &g_ppb_graphics_3d_thunk; | 97 return &g_ppb_graphics_3d_thunk; |
90 } | 98 } |
91 | 99 |
92 } // namespace thunk | 100 } // namespace thunk |
93 } // namespace ppapi | 101 } // namespace ppapi |
OLD | NEW |