OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From ppb_graphics_2d.idl modified Fri Apr 26 08:49:08 2013. */ | 6 /* From ppb_graphics_2d.idl modified Fri Apr 15 13:30:07 2016. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_GRAPHICS_2D_H_ | 8 #ifndef PPAPI_C_PPB_GRAPHICS_2D_H_ |
9 #define PPAPI_C_PPB_GRAPHICS_2D_H_ | 9 #define PPAPI_C_PPB_GRAPHICS_2D_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_point.h" | 15 #include "ppapi/c/pp_point.h" |
16 #include "ppapi/c/pp_rect.h" | 16 #include "ppapi/c/pp_rect.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 /*** | 269 /*** |
270 * GetScale() gets the scale factor that will be applied when painting the | 270 * GetScale() gets the scale factor that will be applied when painting the |
271 * graphics context onto the output device. | 271 * graphics context onto the output device. |
272 * | 272 * |
273 * @param[in] resource A <code>Graphics2D</code> context resource. | 273 * @param[in] resource A <code>Graphics2D</code> context resource. |
274 * | 274 * |
275 * @return Returns the scale factor for the graphics context. If the resource | 275 * @return Returns the scale factor for the graphics context. If the resource |
276 * is not a valid <code>Graphics2D</code> context, this will return 0.0. | 276 * is not a valid <code>Graphics2D</code> context, this will return 0.0. |
277 */ | 277 */ |
278 float (*GetScale)(PP_Resource resource); | 278 float (*GetScale)(PP_Resource resource); |
| 279 /** |
| 280 * SetLayerTransform() sets a transformation factor that will be applied for |
| 281 * the current graphics context displayed on the output device. If both |
| 282 * SetScale and SetLayerTransform will be used, they are going to get combined |
| 283 * for the final result. |
| 284 * This function has no effect until you call Flush(). |
| 285 * @param[in] scale The scale to be applied. |
| 286 * @param[in] origin The origin of the scale. |
| 287 * @param[in] translate The translation to be applied. |
| 288 * |
| 289 * @return Returns <code>true</code> on success or <code>false</code> |
| 290 * if the resource is invalid or the scale factor is 0 or less. |
| 291 */ |
| 292 PP_Bool (*SetLayerTransform)(PP_Resource resource, |
| 293 float scale, |
| 294 const struct PP_Point* origin, |
| 295 const struct PP_Point* translate); |
279 }; | 296 }; |
280 | 297 |
281 typedef struct PPB_Graphics2D_1_1 PPB_Graphics2D; | 298 typedef struct PPB_Graphics2D_1_1 PPB_Graphics2D; |
282 | 299 |
283 struct PPB_Graphics2D_1_0 { | 300 struct PPB_Graphics2D_1_0 { |
284 PP_Resource (*Create)(PP_Instance instance, | 301 PP_Resource (*Create)(PP_Instance instance, |
285 const struct PP_Size* size, | 302 const struct PP_Size* size, |
286 PP_Bool is_always_opaque); | 303 PP_Bool is_always_opaque); |
287 PP_Bool (*IsGraphics2D)(PP_Resource resource); | 304 PP_Bool (*IsGraphics2D)(PP_Resource resource); |
288 PP_Bool (*Describe)(PP_Resource graphics_2d, | 305 PP_Bool (*Describe)(PP_Resource graphics_2d, |
289 struct PP_Size* size, | 306 struct PP_Size* size, |
290 PP_Bool* is_always_opaque); | 307 PP_Bool* is_always_opaque); |
291 void (*PaintImageData)(PP_Resource graphics_2d, | 308 void (*PaintImageData)(PP_Resource graphics_2d, |
292 PP_Resource image_data, | 309 PP_Resource image_data, |
293 const struct PP_Point* top_left, | 310 const struct PP_Point* top_left, |
294 const struct PP_Rect* src_rect); | 311 const struct PP_Rect* src_rect); |
295 void (*Scroll)(PP_Resource graphics_2d, | 312 void (*Scroll)(PP_Resource graphics_2d, |
296 const struct PP_Rect* clip_rect, | 313 const struct PP_Rect* clip_rect, |
297 const struct PP_Point* amount); | 314 const struct PP_Point* amount); |
298 void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); | 315 void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); |
299 int32_t (*Flush)(PP_Resource graphics_2d, | 316 int32_t (*Flush)(PP_Resource graphics_2d, |
300 struct PP_CompletionCallback callback); | 317 struct PP_CompletionCallback callback); |
| 318 PP_Bool (*SetLayerTransform)(PP_Resource resource, |
| 319 float scale, |
| 320 const struct PP_Point* origin, |
| 321 const struct PP_Point* translate); |
301 }; | 322 }; |
302 /** | 323 /** |
303 * @} | 324 * @} |
304 */ | 325 */ |
305 | 326 |
306 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */ | 327 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */ |
307 | 328 |
OLD | NEW |