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 dev/ppb_graphics_2d_dev.idl modified Mon Nov 25 11:02:23 2013.
7 #include "ppapi/c/dev/ppb_graphics_2d_dev.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppapi_thunk_export.h"
12 #include "ppapi/thunk/ppb_graphics_2d_api.h"
19 PP_Bool
SetScale(PP_Resource resource
, float scale
) {
20 VLOG(4) << "PPB_Graphics2D_Dev::SetScale()";
21 EnterResource
<PPB_Graphics2D_API
> enter(resource
, true);
24 return enter
.object()->SetScale(scale
);
27 float GetScale(PP_Resource resource
) {
28 VLOG(4) << "PPB_Graphics2D_Dev::GetScale()";
29 EnterResource
<PPB_Graphics2D_API
> enter(resource
, true);
32 return enter
.object()->GetScale();
35 void SetOffset(PP_Resource resource
, const struct PP_Point
* offset
) {
36 VLOG(4) << "PPB_Graphics2D_Dev::SetOffset()";
37 EnterResource
<PPB_Graphics2D_API
> enter(resource
, true);
40 enter
.object()->SetOffset(offset
);
43 void SetResizeMode(PP_Resource resource
,
44 PP_Graphics2D_Dev_ResizeMode resize_mode
) {
45 VLOG(4) << "PPB_Graphics2D_Dev::SetResizeMode()";
46 EnterResource
<PPB_Graphics2D_API
> enter(resource
, true);
49 enter
.object()->SetResizeMode(resize_mode
);
52 const PPB_Graphics2D_Dev_0_1 g_ppb_graphics2d_dev_thunk_0_1
= {
58 const PPB_Graphics2D_Dev_0_2 g_ppb_graphics2d_dev_thunk_0_2
= {
67 PPAPI_THUNK_EXPORT
const PPB_Graphics2D_Dev_0_1
*
68 GetPPB_Graphics2D_Dev_0_1_Thunk() {
69 return &g_ppb_graphics2d_dev_thunk_0_1
;
72 PPAPI_THUNK_EXPORT
const PPB_Graphics2D_Dev_0_2
*
73 GetPPB_Graphics2D_Dev_0_2_Thunk() {
74 return &g_ppb_graphics2d_dev_thunk_0_2
;