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
3 // found in the LICENSE file.
5 // From ppb_graphics_3d.idl modified Mon Apr 1 08:24:03 2013.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_graphics_3d.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppb_graphics_3d_api.h"
13 #include "ppapi/thunk/ppb_instance_api.h"
14 #include "ppapi/thunk/resource_creation_api.h"
15 #include "ppapi/thunk/thunk.h"
22 int32_t GetAttribMaxValue(PP_Resource instance
,
25 VLOG(4) << "PPB_Graphics3D::GetAttribMaxValue()";
26 EnterResource
<PPB_Graphics3D_API
> enter(instance
, true);
28 return enter
.retval();
29 return enter
.object()->GetAttribMaxValue(attribute
, value
);
32 PP_Resource
Create(PP_Instance instance
,
33 PP_Resource share_context
,
34 const int32_t attrib_list
[]) {
35 VLOG(4) << "PPB_Graphics3D::Create()";
36 EnterResourceCreation
enter(instance
);
39 return enter
.functions()->CreateGraphics3D(instance
,
44 PP_Bool
IsGraphics3D(PP_Resource resource
) {
45 VLOG(4) << "PPB_Graphics3D::IsGraphics3D()";
46 EnterResource
<PPB_Graphics3D_API
> enter(resource
, false);
47 return PP_FromBool(enter
.succeeded());
50 int32_t GetAttribs(PP_Resource context
, int32_t attrib_list
[]) {
51 VLOG(4) << "PPB_Graphics3D::GetAttribs()";
52 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
54 return enter
.retval();
55 return enter
.object()->GetAttribs(attrib_list
);
58 int32_t SetAttribs(PP_Resource context
, const int32_t attrib_list
[]) {
59 VLOG(4) << "PPB_Graphics3D::SetAttribs()";
60 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
62 return enter
.retval();
63 return enter
.object()->SetAttribs(attrib_list
);
66 int32_t GetError(PP_Resource context
) {
67 VLOG(4) << "PPB_Graphics3D::GetError()";
68 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
70 return enter
.retval();
71 return enter
.object()->GetError();
74 int32_t ResizeBuffers(PP_Resource context
, int32_t width
, int32_t height
) {
75 VLOG(4) << "PPB_Graphics3D::ResizeBuffers()";
76 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
78 return enter
.retval();
79 return enter
.object()->ResizeBuffers(width
, height
);
82 int32_t SwapBuffers(PP_Resource context
,
83 struct PP_CompletionCallback callback
) {
84 VLOG(4) << "PPB_Graphics3D::SwapBuffers()";
85 EnterResource
<PPB_Graphics3D_API
> enter(context
, callback
, true);
87 return enter
.retval();
88 return enter
.SetResult(enter
.object()->SwapBuffers(enter
.callback()));
91 const PPB_Graphics3D_1_0 g_ppb_graphics3d_thunk_1_0
= {
104 const PPB_Graphics3D_1_0
* GetPPB_Graphics3D_1_0_Thunk() {
105 return &g_ppb_graphics3d_thunk_1_0
;