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 Thu Oct 31 12:30:06 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/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_graphics_3d_api.h"
20 int32_t GetAttribMaxValue(PP_Resource instance
,
23 VLOG(4) << "PPB_Graphics3D::GetAttribMaxValue()";
24 EnterResource
<PPB_Graphics3D_API
> enter(instance
, true);
26 return enter
.retval();
27 return enter
.object()->GetAttribMaxValue(attribute
, value
);
30 PP_Resource
Create(PP_Instance instance
,
31 PP_Resource share_context
,
32 const int32_t attrib_list
[]) {
33 VLOG(4) << "PPB_Graphics3D::Create()";
34 EnterResourceCreation
enter(instance
);
37 return enter
.functions()->CreateGraphics3D(instance
,
42 PP_Bool
IsGraphics3D(PP_Resource resource
) {
43 VLOG(4) << "PPB_Graphics3D::IsGraphics3D()";
44 EnterResource
<PPB_Graphics3D_API
> enter(resource
, false);
45 return PP_FromBool(enter
.succeeded());
48 int32_t GetAttribs(PP_Resource context
, int32_t attrib_list
[]) {
49 VLOG(4) << "PPB_Graphics3D::GetAttribs()";
50 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
52 return enter
.retval();
53 return enter
.object()->GetAttribs(attrib_list
);
56 int32_t SetAttribs(PP_Resource context
, const int32_t attrib_list
[]) {
57 VLOG(4) << "PPB_Graphics3D::SetAttribs()";
58 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
60 return enter
.retval();
61 return enter
.object()->SetAttribs(attrib_list
);
64 int32_t GetError(PP_Resource context
) {
65 VLOG(4) << "PPB_Graphics3D::GetError()";
66 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
68 return enter
.retval();
69 return enter
.object()->GetError();
72 int32_t ResizeBuffers(PP_Resource context
, int32_t width
, int32_t height
) {
73 VLOG(4) << "PPB_Graphics3D::ResizeBuffers()";
74 EnterResource
<PPB_Graphics3D_API
> enter(context
, true);
76 return enter
.retval();
77 return enter
.object()->ResizeBuffers(width
, height
);
80 int32_t SwapBuffers(PP_Resource context
,
81 struct PP_CompletionCallback callback
) {
82 VLOG(4) << "PPB_Graphics3D::SwapBuffers()";
83 EnterResource
<PPB_Graphics3D_API
> enter(context
, callback
, true);
85 return enter
.retval();
86 return enter
.SetResult(enter
.object()->SwapBuffers(enter
.callback()));
89 const PPB_Graphics3D_1_0 g_ppb_graphics3d_thunk_1_0
= {
102 PPAPI_THUNK_EXPORT
const PPB_Graphics3D_1_0
* GetPPB_Graphics3D_1_0_Thunk() {
103 return &g_ppb_graphics3d_thunk_1_0
;