diff options
-rw-r--r-- | ppapi/api/ppb_graphics_3d.idl | 2 | ||||
-rw-r--r-- | ppapi/shared_impl/ppb_graphics_3d_shared.cc | 6 | ||||
-rw-r--r-- | ppapi/shared_impl/ppb_graphics_3d_shared.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_api.h | 1 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_thunk.cc | 48 |
5 files changed, 38 insertions, 21 deletions
diff --git a/ppapi/api/ppb_graphics_3d.idl b/ppapi/api/ppb_graphics_3d.idl index 34b10af..fc13a09 100644 --- a/ppapi/api/ppb_graphics_3d.idl +++ b/ppapi/api/ppb_graphics_3d.idl @@ -8,6 +8,8 @@ * context within the browser. */ +[generate_thunk] + label Chrome { M15 = 1.0 }; diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc index e2d0154..e480e0c 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc @@ -70,6 +70,12 @@ int32_t PPB_Graphics3D_Shared::SwapBuffers( return DoSwapBuffers(); } +int32_t PPB_Graphics3D_Shared::GetAttribMaxValue(int32_t attribute, + int32_t* value) { + // TODO(alokp): Implement me. + return PP_ERROR_FAILED; +} + void* PPB_Graphics3D_Shared::MapTexSubImage2DCHROMIUM(GLenum target, GLint level, GLint xoffset, diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h index 96bc6bb..482cb4c 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.h +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h @@ -37,6 +37,8 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared virtual int32_t GetError() OVERRIDE; virtual int32_t ResizeBuffers(int32_t width, int32_t height) OVERRIDE; virtual int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback) OVERRIDE; + virtual int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) OVERRIDE; + virtual void* MapTexSubImage2DCHROMIUM(GLenum target, GLint level, GLint xoffset, diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h index 4c7dbe6..dc53b13 100644 --- a/ppapi/thunk/ppb_graphics_3d_api.h +++ b/ppapi/thunk/ppb_graphics_3d_api.h @@ -27,6 +27,7 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { virtual int32_t GetError() = 0; virtual int32_t ResizeBuffers(int32_t width, int32_t height) = 0; virtual int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback) = 0; + virtual int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) = 0; // Graphics3DTrusted API. virtual PP_Bool InitCommandBuffer() = 0; diff --git a/ppapi/thunk/ppb_graphics_3d_thunk.cc b/ppapi/thunk/ppb_graphics_3d_thunk.cc index eb079bb..28946b9 100644 --- a/ppapi/thunk/ppb_graphics_3d_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_thunk.cc @@ -2,26 +2,30 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// From ppb_graphics_3d.idl modified Fri Mar 29 10:54:38 2013. + #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" +#include "ppapi/c/ppb_graphics_3d.h" #include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/enter.h" -#include "ppapi/thunk/thunk.h" #include "ppapi/thunk/ppb_graphics_3d_api.h" +#include "ppapi/thunk/ppb_instance_api.h" #include "ppapi/thunk/resource_creation_api.h" +#include "ppapi/thunk/thunk.h" namespace ppapi { namespace thunk { namespace { -typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; - -int32_t GetAttribMaxValue(PP_Instance instance, +int32_t GetAttribMaxValue(PP_Resource instance, int32_t attribute, int32_t* value) { - // TODO(alokp): Implement me. - return PP_ERROR_FAILED; + EnterResource<PPB_Graphics3D_API> enter(instance, true); + if (enter.failed()) + return enter.retval(); + return enter.object()->GetAttribMaxValue(attribute, value); } PP_Resource Create(PP_Instance instance, @@ -30,51 +34,53 @@ PP_Resource Create(PP_Instance instance, EnterResourceCreation enter(instance); if (enter.failed()) return 0; - return enter.functions()->CreateGraphics3D( - instance, share_context, attrib_list); + return enter.functions()->CreateGraphics3D(instance, + share_context, + attrib_list); } PP_Bool IsGraphics3D(PP_Resource resource) { - EnterGraphics3D enter(resource, false); + EnterResource<PPB_Graphics3D_API> enter(resource, false); return PP_FromBool(enter.succeeded()); } -int32_t GetAttribs(PP_Resource graphics_3d, int32_t attrib_list[]) { - EnterGraphics3D enter(graphics_3d, true); +int32_t GetAttribs(PP_Resource context, int32_t attrib_list[]) { + EnterResource<PPB_Graphics3D_API> enter(context, true); if (enter.failed()) return enter.retval(); return enter.object()->GetAttribs(attrib_list); } -int32_t SetAttribs(PP_Resource graphics_3d, const int32_t attrib_list[]) { - EnterGraphics3D enter(graphics_3d, true); +int32_t SetAttribs(PP_Resource context, const int32_t attrib_list[]) { + EnterResource<PPB_Graphics3D_API> enter(context, true); if (enter.failed()) return enter.retval(); return enter.object()->SetAttribs(attrib_list); } -int32_t GetError(PP_Resource graphics_3d) { - EnterGraphics3D enter(graphics_3d, true); +int32_t GetError(PP_Resource context) { + EnterResource<PPB_Graphics3D_API> enter(context, true); if (enter.failed()) return enter.retval(); return enter.object()->GetError(); } -int32_t ResizeBuffers(PP_Resource graphics_3d, int32_t width, int32_t height) { - EnterGraphics3D enter(graphics_3d, true); +int32_t ResizeBuffers(PP_Resource context, int32_t width, int32_t height) { + EnterResource<PPB_Graphics3D_API> enter(context, true); if (enter.failed()) return enter.retval(); return enter.object()->ResizeBuffers(width, height); } -int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { - EnterGraphics3D enter(graphics_3d, callback, true); +int32_t SwapBuffers(PP_Resource context, + struct PP_CompletionCallback callback) { + EnterResource<PPB_Graphics3D_API> enter(context, callback, true); if (enter.failed()) return enter.retval(); return enter.SetResult(enter.object()->SwapBuffers(enter.callback())); } -const PPB_Graphics3D g_ppb_graphics_3d_thunk = { +const PPB_Graphics3D_1_0 g_ppb_graphics3d_thunk_1_0 = { &GetAttribMaxValue, &Create, &IsGraphics3D, @@ -88,7 +94,7 @@ const PPB_Graphics3D g_ppb_graphics_3d_thunk = { } // namespace const PPB_Graphics3D_1_0* GetPPB_Graphics3D_1_0_Thunk() { - return &g_ppb_graphics_3d_thunk; + return &g_ppb_graphics3d_thunk_1_0; } } // namespace thunk |