| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/cpp/graphics_2d.h" | 5 #include "ppapi/cpp/graphics_2d.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/ppb_graphics_2d.h" | 8 #include "ppapi/c/ppb_graphics_2d.h" |
| 9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
| 10 #include "ppapi/cpp/image_data.h" | 10 #include "ppapi/cpp/image_data.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return PP_ToBool(get_interface<PPB_Graphics2D_1_1>()->SetScale(pp_resource(), | 145 return PP_ToBool(get_interface<PPB_Graphics2D_1_1>()->SetScale(pp_resource(), |
| 146 scale)); | 146 scale)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 float Graphics2D::GetScale() { | 149 float Graphics2D::GetScale() { |
| 150 if (!has_interface<PPB_Graphics2D_1_1>()) | 150 if (!has_interface<PPB_Graphics2D_1_1>()) |
| 151 return 1.0f; | 151 return 1.0f; |
| 152 return get_interface<PPB_Graphics2D_1_1>()->GetScale(pp_resource()); | 152 return get_interface<PPB_Graphics2D_1_1>()->GetScale(pp_resource()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool Graphics2D::SetLayerTransform(float scale, |
| 156 const Point& origin, |
| 157 const Point& translate) { |
| 158 if (!has_interface<PPB_Graphics2D_1_2>()) |
| 159 return false; |
| 160 return PP_ToBool(get_interface<PPB_Graphics2D_1_2>()->SetLayerTransform( |
| 161 pp_resource(), scale, &origin.pp_point(), &translate.pp_point())); |
| 162 } |
| 163 |
| 164 |
| 155 } // namespace pp | 165 } // namespace pp |
| OLD | NEW |