Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: ppapi/cpp/graphics_2d.cc

Issue 12989006: Move HiDPI-related Pepper interfaces to stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after spelling-correction CL Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/graphics_2d.h ('k') | ppapi/cpp/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/graphics_2d.cc
diff --git a/ppapi/cpp/graphics_2d.cc b/ppapi/cpp/graphics_2d.cc
index f4cd6451babf5c73c4a271f09fd9edbc021eba94..1432ee8334092e4af1cbf334005905a51c39df2a 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,17 @@ int32_t Graphics2D::Flush(const CompletionCallback& cc) {
pp_resource(), cc.pp_completion_callback());
}
+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
« no previous file with comments | « ppapi/cpp/graphics_2d.h ('k') | ppapi/cpp/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698