summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/dev
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/cpp/dev')
-rw-r--r--ppapi/cpp/dev/graphics_2d_dev.cc9
-rw-r--r--ppapi/cpp/dev/graphics_2d_dev.h13
2 files changed, 15 insertions, 7 deletions
diff --git a/ppapi/cpp/dev/graphics_2d_dev.cc b/ppapi/cpp/dev/graphics_2d_dev.cc
index 1a04b6a..e141bb6 100644
--- a/ppapi/cpp/dev/graphics_2d_dev.cc
+++ b/ppapi/cpp/dev/graphics_2d_dev.cc
@@ -17,14 +17,19 @@ template <> const char* interface_name<PPB_Graphics2D_Dev>() {
} // namespace
-bool Graphics2DDev::SetScale(float scale) {
+// static
+bool Graphics2D_Dev::SupportsScale() {
+ return has_interface<PPB_Graphics2D_Dev>();
+}
+
+bool Graphics2D_Dev::SetScale(float scale) {
if (!has_interface<PPB_Graphics2D_Dev>())
return false;
return PP_ToBool(get_interface<PPB_Graphics2D_Dev>()->SetScale(pp_resource(),
scale));
}
-float Graphics2DDev::GetScale() {
+float Graphics2D_Dev::GetScale() {
if (!has_interface<PPB_Graphics2D_Dev>())
return 1.0f;
return get_interface<PPB_Graphics2D_Dev>()->GetScale(pp_resource());
diff --git a/ppapi/cpp/dev/graphics_2d_dev.h b/ppapi/cpp/dev/graphics_2d_dev.h
index 2ebc06e..3dc8c71 100644
--- a/ppapi/cpp/dev/graphics_2d_dev.h
+++ b/ppapi/cpp/dev/graphics_2d_dev.h
@@ -11,17 +11,20 @@ namespace pp {
// Graphics2DDev is a version of Graphics2D that exposes under-development APIs
// for HiDPI
-class Graphics2DDev : public Graphics2D {
+class Graphics2D_Dev : public Graphics2D {
public:
/// Default constructor for creating an is_null()
- /// <code>Graphics2DDev</code> object.
- Graphics2DDev() : Graphics2D() {}
+ /// <code>Graphics2D_Dev</code> object.
+ Graphics2D_Dev() : Graphics2D() {}
// Constructor for creating a <code>Graphics2DDev</code> object from an
// existing <code>Graphics2D</code> object.
- Graphics2DDev(const Graphics2D& other) : Graphics2D(other) {}
+ Graphics2D_Dev(const Graphics2D& other) : Graphics2D(other) {}
- virtual ~Graphics2DDev() {}
+ virtual ~Graphics2D_Dev() {}
+
+ /// Returns true if SetScale and GetScale are supported. False if not.
+ static bool SupportsScale();
/// SetScale() sets the scale factor that will be applied when painting the
/// graphics context onto the output device. Typically, if rendering at device