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

Unified Diff: ppapi/thunk/ppb_graphics_2d_thunk.cc

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to Graphics2DDev C++ header Created 8 years, 6 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
Index: ppapi/thunk/ppb_graphics_2d_thunk.cc
diff --git a/ppapi/thunk/ppb_graphics_2d_thunk.cc b/ppapi/thunk/ppb_graphics_2d_thunk.cc
index 393b4c663d63bcde44c287a98be4cd89658ca7fe..52bfe18caedb0f90493247d32a3dba9ea71f3604 100644
--- a/ppapi/thunk/ppb_graphics_2d_thunk.cc
+++ b/ppapi/thunk/ppb_graphics_2d_thunk.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ppapi/c/dev/ppb_graphics_2d_dev.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_graphics_2d.h"
@@ -78,6 +79,20 @@ int32_t Flush(PP_Resource graphics_2d,
return enter.SetResult(enter.object()->Flush(callback));
}
+PP_Bool SetScale(PP_Resource graphics_2d, float scale) {
+ EnterGraphics2D enter(graphics_2d, true);
+ if (enter.failed())
+ return PP_FALSE;
+ return PP_FromBool(enter.object()->SetScale(scale));
+}
+
+float GetScale(PP_Resource graphics_2d) {
+ EnterGraphics2D enter(graphics_2d, true);
+ if (enter.failed())
+ return 0.0f;
+ return enter.object()->GetScale();
+}
+
const PPB_Graphics2D g_ppb_graphics_2d_thunk = {
&Create,
&IsGraphics2D,
@@ -88,11 +103,20 @@ const PPB_Graphics2D g_ppb_graphics_2d_thunk = {
&Flush
};
+const PPB_Graphics2D_Dev g_ppb_graphics_2d_dev_thunk = {
+ &SetScale,
+ &GetScale
+};
+
} // namespace
const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() {
return &g_ppb_graphics_2d_thunk;
}
+const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() {
+ return &g_ppb_graphics_2d_dev_thunk;
+}
+
} // namespace thunk
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698