add SK_SUPPORT_LEGACY_HQ_SCALING to suppress changes to HQ scaling
[chromium-blink-merge.git] / ppapi / thunk / ppb_view_dev_thunk.cc
blob0a2ef275670f9e12c7b63484130ba3a2885749ab
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_view_dev.idl modified Mon May 6 10:11:29 2013.
7 #include "ppapi/c/dev/ppb_view_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_view_api.h"
14 namespace ppapi {
15 namespace thunk {
17 namespace {
19 float GetDeviceScale(PP_Resource resource) {
20 VLOG(4) << "PPB_View_Dev::GetDeviceScale()";
21 EnterResource<PPB_View_API> enter(resource, true);
22 if (enter.failed())
23 return 0.0f;
24 return enter.object()->GetDeviceScale();
27 float GetCSSScale(PP_Resource resource) {
28 VLOG(4) << "PPB_View_Dev::GetCSSScale()";
29 EnterResource<PPB_View_API> enter(resource, true);
30 if (enter.failed())
31 return 0.0f;
32 return enter.object()->GetCSSScale();
35 const PPB_View_Dev_0_1 g_ppb_view_dev_thunk_0_1 = {&GetDeviceScale,
36 &GetCSSScale};
38 } // namespace
40 PPAPI_THUNK_EXPORT const PPB_View_Dev_0_1* GetPPB_View_Dev_0_1_Thunk() {
41 return &g_ppb_view_dev_thunk_0_1;
44 } // namespace thunk
45 } // namespace ppapi