| OLD | NEW |
| (Empty) | |
| 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 #include "ppapi/cpp/dev/graphics_2d_dev.h" |
| 6 |
| 7 #include "ppapi/c/dev/ppb_graphics_2d_dev.h" |
| 8 #include "ppapi/cpp/module_impl.h" |
| 9 |
| 10 namespace pp { |
| 11 |
| 12 namespace { |
| 13 |
| 14 template <> const char* interface_name<PPB_Graphics2D_Dev>() { |
| 15 return PPB_GRAPHICS2D_DEV_INTERFACE; |
| 16 } |
| 17 |
| 18 } // namespace |
| 19 |
| 20 bool Graphics2DDev::SetScale(float scale) { |
| 21 if (!has_interface<PPB_Graphics2D_Dev>()) |
| 22 return false; |
| 23 return PP_ToBool(get_interface<PPB_Graphics2D_Dev>()->SetScale(pp_resource(), |
| 24 scale)); |
| 25 } |
| 26 |
| 27 float Graphics2DDev::GetScale() { |
| 28 if (!has_interface<PPB_Graphics2D_Dev>()) |
| 29 return 1.0f; |
| 30 return get_interface<PPB_Graphics2D_Dev>()->GetScale(pp_resource()); |
| 31 } |
| 32 |
| 33 } // namespace pp |
| OLD | NEW |