Roll leveldb from r73 to r75.
[chromium-blink-merge.git] / ppapi / cpp / dev / graphics_2d_dev.cc
blobe141bb6b705c07cbf6665c80dd326ad10cbf5370
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 #include "ppapi/cpp/dev/graphics_2d_dev.h"
7 #include "ppapi/c/dev/ppb_graphics_2d_dev.h"
8 #include "ppapi/cpp/module_impl.h"
10 namespace pp {
12 namespace {
14 template <> const char* interface_name<PPB_Graphics2D_Dev>() {
15 return PPB_GRAPHICS2D_DEV_INTERFACE;
18 } // namespace
20 // static
21 bool Graphics2D_Dev::SupportsScale() {
22 return has_interface<PPB_Graphics2D_Dev>();
25 bool Graphics2D_Dev::SetScale(float scale) {
26 if (!has_interface<PPB_Graphics2D_Dev>())
27 return false;
28 return PP_ToBool(get_interface<PPB_Graphics2D_Dev>()->SetScale(pp_resource(),
29 scale));
32 float Graphics2D_Dev::GetScale() {
33 if (!has_interface<PPB_Graphics2D_Dev>())
34 return 1.0f;
35 return get_interface<PPB_Graphics2D_Dev>()->GetScale(pp_resource());
38 } // namespace pp