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

Unified Diff: ppapi/c/ppb_graphics_2d.h

Issue 1881603002: Added SetLayerTransform to PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added M52 to API idl Created 4 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
Index: ppapi/c/ppb_graphics_2d.h
diff --git a/ppapi/c/ppb_graphics_2d.h b/ppapi/c/ppb_graphics_2d.h
index 251f34e33c2eb3546e523bf28f17ab28b1272aad..2c55a2840a067057d79ac3c7474e35faa982ff6a 100644
--- a/ppapi/c/ppb_graphics_2d.h
+++ b/ppapi/c/ppb_graphics_2d.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_graphics_2d.idl modified Fri Apr 26 08:49:08 2013. */
+/* From ppb_graphics_2d.idl modified Fri Apr 15 15:37:20 2016. */
#ifndef PPAPI_C_PPB_GRAPHICS_2D_H_
#define PPAPI_C_PPB_GRAPHICS_2D_H_
@@ -20,7 +20,8 @@
#define PPB_GRAPHICS_2D_INTERFACE_1_0 "PPB_Graphics2D;1.0"
#define PPB_GRAPHICS_2D_INTERFACE_1_1 "PPB_Graphics2D;1.1"
-#define PPB_GRAPHICS_2D_INTERFACE PPB_GRAPHICS_2D_INTERFACE_1_1
+#define PPB_GRAPHICS_2D_INTERFACE_1_2 "PPB_Graphics2D;1.2"
+#define PPB_GRAPHICS_2D_INTERFACE PPB_GRAPHICS_2D_INTERFACE_1_2
/**
* @file
@@ -36,7 +37,7 @@
/**
* <code>PPB_Graphics2D</code> defines the interface for a 2D graphics context.
*/
-struct PPB_Graphics2D_1_1 {
+struct PPB_Graphics2D_1_2 {
/**
* Create() creates a 2D graphics context. The returned graphics context will
* not be bound to the module instance on creation (call BindGraphics() on
@@ -83,7 +84,8 @@ struct PPB_Graphics2D_1_1 {
* will be painted.
*
* @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if
- * the resource is invalid. The output parameters will be set to 0 on a
+ * theomments + 1 draft Download
+ * M resource is invalid. The output parameters will be set to 0 on a
* <code>PP_FALSE</code>.
*/
PP_Bool (*Describe)(PP_Resource graphics_2d,
@@ -133,6 +135,8 @@ struct PPB_Graphics2D_1_1 {
const struct PP_Point* top_left,
const struct PP_Rect* src_rect);
/**
+ *
+ *
* Scroll() enqueues a scroll of the context's backing store. This
* function has no effect until you call Flush(). The data within the
* provided clipping rectangle will be shifted by (dx, dy) pixels.
@@ -276,9 +280,26 @@ struct PPB_Graphics2D_1_1 {
* is not a valid <code>Graphics2D</code> context, this will return 0.0.
*/
float (*GetScale)(PP_Resource resource);
+ /**
+ * SetLayerTransform() sets a transformation factor that will be applied for
+ * the current graphics context displayed on the output device. If both
+ * SetScale and SetLayerTransform will be used, they are going to get combined
+ * for the final result.
+ * This function has no effect until you call Flush().
+ * @param[in] scale The scale to be applied.
+ * @param[in] origin The origin of the scale.
+ * @param[in] translate The translation to be applied.
+ *
+ * @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.
+ */
+ PP_Bool (*SetLayerTransform)(PP_Resource resource,
+ float scale,
+ const struct PP_Point* origin,
+ const struct PP_Point* translate);
};
-typedef struct PPB_Graphics2D_1_1 PPB_Graphics2D;
+typedef struct PPB_Graphics2D_1_2 PPB_Graphics2D;
struct PPB_Graphics2D_1_0 {
PP_Resource (*Create)(PP_Instance instance,
@@ -299,6 +320,28 @@ struct PPB_Graphics2D_1_0 {
int32_t (*Flush)(PP_Resource graphics_2d,
struct PP_CompletionCallback callback);
};
+
+struct PPB_Graphics2D_1_1 {
+ PP_Resource (*Create)(PP_Instance instance,
+ const struct PP_Size* size,
+ PP_Bool is_always_opaque);
+ PP_Bool (*IsGraphics2D)(PP_Resource resource);
+ PP_Bool (*Describe)(PP_Resource graphics_2d,
+ struct PP_Size* size,
+ PP_Bool* is_always_opaque);
+ void (*PaintImageData)(PP_Resource graphics_2d,
+ PP_Resource image_data,
+ const struct PP_Point* top_left,
+ const struct PP_Rect* src_rect);
+ void (*Scroll)(PP_Resource graphics_2d,
+ const struct PP_Rect* clip_rect,
+ const struct PP_Point* amount);
+ void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data);
+ int32_t (*Flush)(PP_Resource graphics_2d,
+ struct PP_CompletionCallback callback);
+ PP_Bool (*SetScale)(PP_Resource resource, float scale);
+ float (*GetScale)(PP_Resource resource);
+};
/**
* @}
*/

Powered by Google App Engine
This is Rietveld 408576698