| Index: ppapi/cpp/graphics_2d.cc
|
| diff --git a/ppapi/cpp/graphics_2d.cc b/ppapi/cpp/graphics_2d.cc
|
| index f4cd6451babf5c73c4a271f09fd9edbc021eba94..0cb4ef6b284c9a178a3ea08446d2a44b73bd203e 100644
|
| --- a/ppapi/cpp/graphics_2d.cc
|
| +++ b/ppapi/cpp/graphics_2d.cc
|
| @@ -22,6 +22,10 @@ template <> const char* interface_name<PPB_Graphics2D_1_0>() {
|
| return PPB_GRAPHICS_2D_INTERFACE_1_0;
|
| }
|
|
|
| +template <> const char* interface_name<PPB_Graphics2D_1_1>() {
|
| + return PPB_GRAPHICS_2D_INTERFACE_1_1;
|
| +}
|
| +
|
| } // namespace
|
|
|
| Graphics2D::Graphics2D() : Resource() {
|
| @@ -104,4 +108,22 @@ int32_t Graphics2D::Flush(const CompletionCallback& cc) {
|
| pp_resource(), cc.pp_completion_callback());
|
| }
|
|
|
| +// static
|
| +bool Graphics2D::SupportsScale() {
|
| + return has_interface<PPB_Graphics2D_1_1>();
|
| +}
|
| +
|
| +bool Graphics2D::SetScale(float scale) {
|
| + if (!has_interface<PPB_Graphics2D_1_1>())
|
| + return false;
|
| + return PP_ToBool(get_interface<PPB_Graphics2D_1_1>()->SetScale(pp_resource(),
|
| + scale));
|
| +}
|
| +
|
| +float Graphics2D::GetScale() {
|
| + if (!has_interface<PPB_Graphics2D_1_1>())
|
| + return 1.0f;
|
| + return get_interface<PPB_Graphics2D_1_1>()->GetScale(pp_resource());
|
| +}
|
| +
|
| } // namespace pp
|
|
|