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

Unified Diff: ppapi/api/ppb_graphics_2d.idl

Issue 12989006: Move HiDPI-related Pepper interfaces to stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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 | « no previous file | ppapi/api/ppb_view.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/ppb_graphics_2d.idl
diff --git a/ppapi/api/ppb_graphics_2d.idl b/ppapi/api/ppb_graphics_2d.idl
index 1dddc65ba9639a5ca8ac1e6f77d4adc7ba3b206a..f9b420d574073e6265ca9a6112c3afbac8a1d577 100644
--- a/ppapi/api/ppb_graphics_2d.idl
+++ b/ppapi/api/ppb_graphics_2d.idl
@@ -9,7 +9,8 @@
*/
label Chrome {
- M14 = 1.0
+ M14 = 1.0,
+ M27 = 1.1
};
/**
@@ -242,5 +243,41 @@ interface PPB_Graphics2D {
int32_t Flush(
[in] PP_Resource graphics_2d,
[in] PP_CompletionCallback callback);
+
+ /**
+ * SetScale() sets the scale factor that will be applied when painting the
+ * graphics context onto the output device. Typically, if rendering at device
+ * resolution is desired, the context would be created with the width and
+ * height scaled up by the view's GetDeviceScale and SetScale called with a
+ * scale of 1.0 / GetDeviceScale(). For example, if the view resource passed
+ * to DidChangeView has a rectangle of (w=200, h=100) and a device scale of
+ * 2.0, one would call Create with a size of (w=400, h=200) and then call
+ * SetScale with 0.5. One would then treat each pixel in the context as a
+ * single device pixel.
+ *
+ * @param[in] resource A <code>Graphics2D</code> context resource.
+ * @param[in] scale The scale to apply when painting.
+ *
+ * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if
+ * the resource is invalid or the scale factor is 0 or less.
+ */
+ [version=1.1]
+ PP_Bool SetScale(
+ [in] PP_Resource resource,
+ [in] float_t scale);
+
+ /***
+ * GetScale() gets the scale factor that will be applied when painting the
+ * graphics context onto the output device.
+ *
+ * @param[in] resource A <code>Graphics2D</code> context resource.
+ *
+ * @return Returns the scale factor for the graphics context. If the resource
+ * is not a valid <code>Graphics2D</code> context, this will return 0.0.
+ */
+ [version=1.1]
+ float_t GetScale(
+ [in] PP_Resource resource);
+
};
« no previous file with comments | « no previous file | ppapi/api/ppb_view.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698