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

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: 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..8ddf0000c4d8f5ac59eeaf1d670bc648c235b904 100644
--- a/ppapi/thunk/ppb_graphics_2d_thunk.cc
+++ b/ppapi/thunk/ppb_graphics_2d_thunk.cc
@@ -5,6 +5,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_graphics_2d.h"
+#include "ppapi/c/private/ppb_graphics_2d_private.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_graphics_2d_api.h"
#include "ppapi/thunk/resource_creation_api.h"
@@ -23,7 +24,23 @@ PP_Resource Create(PP_Instance instance,
EnterResourceCreation enter(instance);
if (enter.failed())
return 0;
- return enter.functions()->CreateGraphics2D(instance, *size, is_always_opaque);
+ return enter.functions()->CreateGraphics2D(instance,
+ *size,
+ is_always_opaque,
+ 1.0f);
+}
+
+PP_Resource CreateWithScale(PP_Instance instance,
+ const PP_Size* size,
+ PP_Bool is_always_opaque,
+ float scale) {
+ EnterResourceCreation enter(instance);
+ if (enter.failed())
+ return 0;
+ return enter.functions()->CreateGraphics2D(instance,
+ *size,
+ is_always_opaque,
+ scale);
}
PP_Bool IsGraphics2D(PP_Resource resource) {
@@ -88,11 +105,19 @@ const PPB_Graphics2D g_ppb_graphics_2d_thunk = {
&Flush
};
+const PPB_Graphics2D_Private g_ppb_graphics_2d_private_thunk = {
+ &CreateWithScale
+};
+
} // namespace
const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() {
return &g_ppb_graphics_2d_thunk;
}
+const PPB_Graphics2D_Private_0_1* GetPPB_Graphics2D_Private_0_1_Thunk() {
+ return &g_ppb_graphics_2d_private_thunk;
+}
+
} // namespace thunk
} // namespace ppapi

Powered by Google App Engine
This is Rietveld 408576698