Home | History | Annotate | Download | only in thunk
      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.
      4 
      5 // From dev/ppb_graphics_2d_dev.idl modified Fri Apr 26 08:52:02 2013.
      6 
      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/ppb_graphics_2d_api.h"
     12 #include "ppapi/thunk/ppb_instance_api.h"
     13 #include "ppapi/thunk/resource_creation_api.h"
     14 #include "ppapi/thunk/thunk.h"
     15 
     16 namespace ppapi {
     17 namespace thunk {
     18 
     19 namespace {
     20 
     21 PP_Bool SetScale(PP_Resource resource, float scale) {
     22   VLOG(4) << "PPB_Graphics2D_Dev::SetScale()";
     23   EnterResource<PPB_Graphics2D_API> enter(resource, true);
     24   if (enter.failed())
     25     return PP_FALSE;
     26   return enter.object()->SetScale(scale);
     27 }
     28 
     29 float GetScale(PP_Resource resource) {
     30   VLOG(4) << "PPB_Graphics2D_Dev::GetScale()";
     31   EnterResource<PPB_Graphics2D_API> enter(resource, true);
     32   if (enter.failed())
     33     return 0.0f;
     34   return enter.object()->GetScale();
     35 }
     36 
     37 const PPB_Graphics2D_Dev_0_1 g_ppb_graphics2d_dev_thunk_0_1 = {
     38   &SetScale,
     39   &GetScale
     40 };
     41 
     42 }  // namespace
     43 
     44 const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() {
     45   return &g_ppb_graphics2d_dev_thunk_0_1;
     46 }
     47 
     48 }  // namespace thunk
     49 }  // namespace ppapi
     50