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

Unified Diff: ppapi/thunk/ppb_view_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_thunk.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_view_thunk.cc
diff --git a/ppapi/thunk/ppb_view_thunk.cc b/ppapi/thunk/ppb_view_thunk.cc
index 874513b6b30d7e5e3f71438e4af77594ef38e9f0..ea6f6245311a617f91f5d6a8ab220777ab370551 100644
--- a/ppapi/thunk/ppb_view_thunk.cc
+++ b/ppapi/thunk/ppb_view_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_view_dev.h"
#include "ppapi/c/ppb_view.h"
#include "ppapi/shared_impl/ppb_view_shared.h"
#include "ppapi/thunk/enter.h"
@@ -77,6 +78,20 @@ PP_Bool GetClipRect(PP_Resource resource, PP_Rect* clip) {
return PP_TRUE;
}
+float GetDeviceScale(PP_Resource resource) {
+ EnterView enter(resource, true);
+ if (enter.failed())
+ return 0.0f;
+ return enter.object()->GetData().device_scale;
+}
+
+float GetCSSScale(PP_Resource resource) {
+ EnterView enter(resource, true);
+ if (enter.failed())
+ return 0.0f;
+ return enter.object()->GetData().css_scale;
+}
+
const PPB_View g_ppb_view_thunk = {
&IsView,
&GetRect,
@@ -86,11 +101,20 @@ const PPB_View g_ppb_view_thunk = {
&GetClipRect
};
+const PPB_View_Dev g_ppb_view_dev_thunk = {
+ &GetDeviceScale,
+ &GetCSSScale
+};
+
} // namespace
const PPB_View* GetPPB_View_1_0_Thunk() {
return &g_ppb_view_thunk;
}
+const PPB_View_Dev* GetPPB_View_Dev_0_1_Thunk() {
+ return &g_ppb_view_dev_thunk;
+}
+
} // namespace thunk
} // namespace ppapi
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_thunk.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698