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

Side by Side 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: Changes for version 1.2 of Graphics2D 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 unified diff | Download patch
OLDNEW
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 Mon Apr 18 10:18:58 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"
17 #include "ppapi/c/pp_resource.h" 17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_size.h" 18 #include "ppapi/c/pp_size.h"
19 #include "ppapi/c/pp_stdint.h" 19 #include "ppapi/c/pp_stdint.h"
20 20
21 #define PPB_GRAPHICS_2D_INTERFACE_1_0 "PPB_Graphics2D;1.0" 21 #define PPB_GRAPHICS_2D_INTERFACE_1_0 "PPB_Graphics2D;1.0"
22 #define PPB_GRAPHICS_2D_INTERFACE_1_1 "PPB_Graphics2D;1.1" 22 #define PPB_GRAPHICS_2D_INTERFACE_1_1 "PPB_Graphics2D;1.1"
23 #define PPB_GRAPHICS_2D_INTERFACE PPB_GRAPHICS_2D_INTERFACE_1_1 23 #define PPB_GRAPHICS_2D_INTERFACE_1_2 "PPB_Graphics2D;1.2"
24 #define PPB_GRAPHICS_2D_INTERFACE PPB_GRAPHICS_2D_INTERFACE_1_2
24 25
25 /** 26 /**
26 * @file 27 * @file
27 * Defines the <code>PPB_Graphics2D</code> struct representing a 2D graphics 28 * Defines the <code>PPB_Graphics2D</code> struct representing a 2D graphics
28 * context within the browser. 29 * context within the browser.
29 */ 30 */
30 31
31 32
32 /** 33 /**
33 * @addtogroup Interfaces 34 * @addtogroup Interfaces
34 * @{ 35 * @{
35 */ 36 */
36 /** 37 /**
37 * <code>PPB_Graphics2D</code> defines the interface for a 2D graphics context. 38 * <code>PPB_Graphics2D</code> defines the interface for a 2D graphics context.
38 */ 39 */
39 struct PPB_Graphics2D_1_1 { 40 struct PPB_Graphics2D_1_2 {
40 /** 41 /**
41 * Create() creates a 2D graphics context. The returned graphics context will 42 * Create() creates a 2D graphics context. The returned graphics context will
42 * not be bound to the module instance on creation (call BindGraphics() on 43 * not be bound to the module instance on creation (call BindGraphics() on
43 * the module instance to bind the returned graphics context to the module 44 * the module instance to bind the returned graphics context to the module
44 * instance). 45 * instance).
45 * 46 *
46 * @param[in] instance The module instance. 47 * @param[in] instance The module instance.
47 * @param[in] size The size of the graphic context. 48 * @param[in] size The size of the graphic context.
48 * @param[in] is_always_opaque Set the <code>is_always_opaque</code> flag to 49 * @param[in] is_always_opaque Set the <code>is_always_opaque</code> flag to
49 * <code>PP_TRUE</code> if you know that you will be painting only opaque 50 * <code>PP_TRUE</code> if you know that you will be painting only opaque
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 /*** 270 /***
270 * GetScale() gets the scale factor that will be applied when painting the 271 * GetScale() gets the scale factor that will be applied when painting the
271 * graphics context onto the output device. 272 * graphics context onto the output device.
272 * 273 *
273 * @param[in] resource A <code>Graphics2D</code> context resource. 274 * @param[in] resource A <code>Graphics2D</code> context resource.
274 * 275 *
275 * @return Returns the scale factor for the graphics context. If the resource 276 * @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. 277 * is not a valid <code>Graphics2D</code> context, this will return 0.0.
277 */ 278 */
278 float (*GetScale)(PP_Resource resource); 279 float (*GetScale)(PP_Resource resource);
280 /**
281 * SetLayerTransform() sets a transformation factor that will be applied for
282 * the current graphics context displayed on the output device. If both
283 * SetScale and SetLayerTransform will be used, they are going to get combined
284 * for the final result.
285 * This function has no effect until you call Flush().
286 * @param[in] scale The scale to be applied.
287 * @param[in] origin The origin of the scale.
288 * @param[in] translate The translation to be applied.
289 *
290 * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code>
291 * if the resource is invalid or the scale factor is 0 or less.
292 */
293 PP_Bool (*SetLayerTransform)(PP_Resource resource,
294 float scale,
295 const struct PP_Point* origin,
296 const struct PP_Point* translate);
279 }; 297 };
280 298
281 typedef struct PPB_Graphics2D_1_1 PPB_Graphics2D; 299 typedef struct PPB_Graphics2D_1_2 PPB_Graphics2D;
282 300
283 struct PPB_Graphics2D_1_0 { 301 struct PPB_Graphics2D_1_0 {
284 PP_Resource (*Create)(PP_Instance instance, 302 PP_Resource (*Create)(PP_Instance instance,
285 const struct PP_Size* size, 303 const struct PP_Size* size,
286 PP_Bool is_always_opaque); 304 PP_Bool is_always_opaque);
287 PP_Bool (*IsGraphics2D)(PP_Resource resource); 305 PP_Bool (*IsGraphics2D)(PP_Resource resource);
288 PP_Bool (*Describe)(PP_Resource graphics_2d, 306 PP_Bool (*Describe)(PP_Resource graphics_2d,
289 struct PP_Size* size, 307 struct PP_Size* size,
290 PP_Bool* is_always_opaque); 308 PP_Bool* is_always_opaque);
291 void (*PaintImageData)(PP_Resource graphics_2d, 309 void (*PaintImageData)(PP_Resource graphics_2d,
292 PP_Resource image_data, 310 PP_Resource image_data,
293 const struct PP_Point* top_left, 311 const struct PP_Point* top_left,
294 const struct PP_Rect* src_rect); 312 const struct PP_Rect* src_rect);
295 void (*Scroll)(PP_Resource graphics_2d, 313 void (*Scroll)(PP_Resource graphics_2d,
296 const struct PP_Rect* clip_rect, 314 const struct PP_Rect* clip_rect,
297 const struct PP_Point* amount); 315 const struct PP_Point* amount);
298 void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data); 316 void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data);
299 int32_t (*Flush)(PP_Resource graphics_2d, 317 int32_t (*Flush)(PP_Resource graphics_2d,
300 struct PP_CompletionCallback callback); 318 struct PP_CompletionCallback callback);
301 }; 319 };
320
321 struct PPB_Graphics2D_1_1 {
322 PP_Resource (*Create)(PP_Instance instance,
323 const struct PP_Size* size,
324 PP_Bool is_always_opaque);
325 PP_Bool (*IsGraphics2D)(PP_Resource resource);
326 PP_Bool (*Describe)(PP_Resource graphics_2d,
327 struct PP_Size* size,
328 PP_Bool* is_always_opaque);
329 void (*PaintImageData)(PP_Resource graphics_2d,
330 PP_Resource image_data,
331 const struct PP_Point* top_left,
332 const struct PP_Rect* src_rect);
333 void (*Scroll)(PP_Resource graphics_2d,
334 const struct PP_Rect* clip_rect,
335 const struct PP_Point* amount);
336 void (*ReplaceContents)(PP_Resource graphics_2d, PP_Resource image_data);
337 int32_t (*Flush)(PP_Resource graphics_2d,
338 struct PP_CompletionCallback callback);
339 PP_Bool (*SetScale)(PP_Resource resource, float scale);
340 float (*GetScale)(PP_Resource resource);
341 };
302 /** 342 /**
303 * @} 343 * @}
304 */ 344 */
305 345
306 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */ 346 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */
307 347
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698