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 /** | 6 /** |
7 * Defines the <code>PPB_Graphics2D</code> struct representing a 2D graphics | 7 * Defines the <code>PPB_Graphics2D</code> struct representing a 2D graphics |
8 * context within the browser. | 8 * context within the browser. |
9 */ | 9 */ |
10 | 10 |
11 [generate_thunk] | 11 [generate_thunk] |
12 | 12 |
13 label Chrome { | 13 label Chrome { |
14 M14 = 1.0, | 14 M14 = 1.0, |
15 M27 = 1.1 | 15 M27 = 1.1, |
16 M52 = 1.2 | |
16 }; | 17 }; |
17 | 18 |
18 /** | 19 /** |
19 * <code>PPB_Graphics2D</code> defines the interface for a 2D graphics context. | 20 * <code>PPB_Graphics2D</code> defines the interface for a 2D graphics context. |
20 */ | 21 */ |
21 [macro="PPB_GRAPHICS_2D_INTERFACE"] | 22 [macro="PPB_GRAPHICS_2D_INTERFACE"] |
22 interface PPB_Graphics2D { | 23 interface PPB_Graphics2D { |
23 /** | 24 /** |
24 * Create() creates a 2D graphics context. The returned graphics context will | 25 * Create() creates a 2D graphics context. The returned graphics context will |
25 * not be bound to the module instance on creation (call BindGraphics() on | 26 * not be bound to the module instance on creation (call BindGraphics() on |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 /** | 64 /** |
64 * Describe() retrieves the configuration for the given graphics context, | 65 * Describe() retrieves the configuration for the given graphics context, |
65 * filling the given values (which must not be <code>NULL</code>). | 66 * filling the given values (which must not be <code>NULL</code>). |
66 * | 67 * |
67 * @param[in] resource The 2D Graphics resource. | 68 * @param[in] resource The 2D Graphics resource. |
68 * @param[in,out] size The size of the 2D graphics context in the browser. | 69 * @param[in,out] size The size of the 2D graphics context in the browser. |
69 * @param[in,out] is_always_opaque Identifies whether only opaque data | 70 * @param[in,out] is_always_opaque Identifies whether only opaque data |
70 * will be painted. | 71 * will be painted. |
71 * | 72 * |
72 * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if | 73 * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if |
73 * the resource is invalid. The output parameters will be set to 0 on a | 74 * theomments + 1 draft» Download |
75 * M» resource is invalid. The output parameters will be set to 0 on a | |
piman
2016/04/15 20:12:28
bad copy & paste?
alessandroa
2016/04/21 15:39:22
Done.
| |
74 * <code>PP_FALSE</code>. | 76 * <code>PP_FALSE</code>. |
75 */ | 77 */ |
76 [always_set_output_parameters] | 78 [always_set_output_parameters] |
77 PP_Bool Describe( | 79 PP_Bool Describe( |
78 [in] PP_Resource graphics_2d, | 80 [in] PP_Resource graphics_2d, |
79 [out] PP_Size size, | 81 [out] PP_Size size, |
80 [out] PP_Bool is_always_opaque); | 82 [out] PP_Bool is_always_opaque); |
81 | 83 |
82 /** | 84 /** |
83 * PaintImageData() enqueues a paint of the given image into the context. | 85 * PaintImageData() enqueues a paint of the given image into the context. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 * @param[in] src_rect The rectangular area where the <code>ImageData</code> | 120 * @param[in] src_rect The rectangular area where the <code>ImageData</code> |
119 * will be painted. | 121 * will be painted. |
120 */ | 122 */ |
121 void PaintImageData( | 123 void PaintImageData( |
122 [in] PP_Resource graphics_2d, | 124 [in] PP_Resource graphics_2d, |
123 [in] PP_Resource image_data, | 125 [in] PP_Resource image_data, |
124 [in] PP_Point top_left, | 126 [in] PP_Point top_left, |
125 [in] PP_Rect src_rect); | 127 [in] PP_Rect src_rect); |
126 | 128 |
127 /** | 129 /** |
130 mments + 1 draft Download | |
131 M | |
piman
2016/04/15 20:12:28
same?
alessandroa
2016/04/21 15:39:22
Done.
| |
128 * Scroll() enqueues a scroll of the context's backing store. This | 132 * Scroll() enqueues a scroll of the context's backing store. This |
129 * function has no effect until you call Flush(). The data within the | 133 * function has no effect until you call Flush(). The data within the |
130 * provided clipping rectangle will be shifted by (dx, dy) pixels. | 134 * provided clipping rectangle will be shifted by (dx, dy) pixels. |
131 * | 135 * |
132 * This function will result in some exposed region which will have undefined | 136 * This function will result in some exposed region which will have undefined |
133 * contents. The module should call PaintImageData() on these exposed regions | 137 * contents. The module should call PaintImageData() on these exposed regions |
134 * to give the correct contents. | 138 * to give the correct contents. |
135 * | 139 * |
136 * The scroll can be larger than the area of the clipping rectangle, which | 140 * The scroll can be larger than the area of the clipping rectangle, which |
137 * means the current image will be scrolled out of the rectangle. This | 141 * means the current image will be scrolled out of the rectangle. This |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 * | 279 * |
276 * @param[in] resource A <code>Graphics2D</code> context resource. | 280 * @param[in] resource A <code>Graphics2D</code> context resource. |
277 * | 281 * |
278 * @return Returns the scale factor for the graphics context. If the resource | 282 * @return Returns the scale factor for the graphics context. If the resource |
279 * is not a valid <code>Graphics2D</code> context, this will return 0.0. | 283 * is not a valid <code>Graphics2D</code> context, this will return 0.0. |
280 */ | 284 */ |
281 [version=1.1] | 285 [version=1.1] |
282 float_t GetScale( | 286 float_t GetScale( |
283 [in] PP_Resource resource); | 287 [in] PP_Resource resource); |
284 | 288 |
289 /** | |
290 * SetLayerTransform() sets a transformation factor that will be applied for | |
291 * the current graphics context displayed on the output device. If both | |
292 * SetScale and SetLayerTransform will be used, they are going to get combined | |
293 * for the final result. | |
294 * This function has no effect until you call Flush(). | |
295 * @param[in] scale The scale to be applied. | |
296 * @param[in] origin The origin of the scale. | |
297 * @param[in] translate The translation to be applied. | |
298 * | |
299 * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> | |
300 * if the resource is invalid or the scale factor is 0 or less. | |
301 */ | |
302 [version=1.2] | |
303 PP_Bool SetLayerTransform( | |
304 [in] PP_Resource resource, | |
305 [in] float_t scale, | |
306 [in] PP_Point origin, | |
307 [in] PP_Point translate); | |
285 }; | 308 }; |
286 | 309 |
OLD | NEW |