1 // Copyright 2014 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_compositor.idl modified Thu Sep 18 11:36:39 2014.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_compositor.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_compositor_api.h"
20 PP_Bool
IsCompositor(PP_Resource resource
) {
21 VLOG(4) << "PPB_Compositor::IsCompositor()";
22 EnterResource
<PPB_Compositor_API
> enter(resource
, false);
23 return PP_FromBool(enter
.succeeded());
26 PP_Resource
Create(PP_Instance instance
) {
27 VLOG(4) << "PPB_Compositor::Create()";
28 EnterResourceCreation
enter(instance
);
31 return enter
.functions()->CreateCompositor(instance
);
34 PP_Resource
AddLayer(PP_Resource compositor
) {
35 VLOG(4) << "PPB_Compositor::AddLayer()";
36 EnterResource
<PPB_Compositor_API
> enter(compositor
, true);
39 return enter
.object()->AddLayer();
42 int32_t CommitLayers(PP_Resource compositor
, struct PP_CompletionCallback cc
) {
43 VLOG(4) << "PPB_Compositor::CommitLayers()";
44 EnterResource
<PPB_Compositor_API
> enter(compositor
, cc
, true);
46 return enter
.retval();
47 return enter
.SetResult(enter
.object()->CommitLayers(enter
.callback()));
50 int32_t ResetLayers(PP_Resource compositor
) {
51 VLOG(4) << "PPB_Compositor::ResetLayers()";
52 EnterResource
<PPB_Compositor_API
> enter(compositor
, true);
54 return enter
.retval();
55 return enter
.object()->ResetLayers();
58 const PPB_Compositor_0_1 g_ppb_compositor_thunk_0_1
= {&IsCompositor
,
66 PPAPI_THUNK_EXPORT
const PPB_Compositor_0_1
* GetPPB_Compositor_0_1_Thunk() {
67 return &g_ppb_compositor_thunk_0_1
;