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

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: Rebase 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
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_api.h ('k') | ppapi/thunk/ppb_view_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1d76bba317bf140e4371b1370a30dbc327c2fa67..4deabc1a45246ccfc3cde1520b108c262307a503 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, PP_CompletionCallback callback) {
return enter.SetResult(enter.object()->Flush(enter.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
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_api.h ('k') | ppapi/thunk/ppb_view_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698