OLD | NEW |
1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_PPB_GRAPHICS_2D_H_ | 5 #ifndef PPAPI_C_PPB_GRAPHICS_2D_H_ |
6 #define PPAPI_C_PPB_GRAPHICS_2D_H_ | 6 #define PPAPI_C_PPB_GRAPHICS_2D_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
10 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
12 | 13 |
13 struct PP_CompletionCallback; | 14 struct PP_CompletionCallback; |
14 struct PP_Point; | 15 struct PP_Point; |
15 struct PP_Rect; | 16 struct PP_Rect; |
16 struct PP_Size; | 17 struct PP_Size; |
17 | 18 |
18 #define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.2" | 19 #define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.3" |
19 | 20 |
20 /** | 21 /** |
21 * @file | 22 * @file |
22 * Defines the PPB_Graphics2D struct. | 23 * Defines the PPB_Graphics2D struct. |
23 * | 24 * |
24 * @addtogroup PPB | 25 * @addtogroup PPB |
25 * @{ | 26 * @{ |
26 */ | 27 */ |
27 | 28 |
28 /** {PENDING: describe PPB_Graphics2D. */ | 29 /** {PENDING: describe PPB_Graphics2D. */ |
29 struct PPB_Graphics2D { | 30 struct PPB_Graphics2D { |
30 /** | 31 /** |
31 * The returned graphics context will not be bound to any plugin instance on | 32 * The returned graphics context will not be bound to the plugin instance on |
32 * creation (call BindGraphics on the plugin instance to do that. The | 33 * creation (call BindGraphics on the plugin instance to do that). |
33 * graphics context has a lifetime that can exceed that of the given plugin | |
34 * instance. | |
35 * | 34 * |
36 * Set the is_always_opaque flag if you know that you will be painting only | 35 * Set the is_always_opaque flag if you know that you will be painting only |
37 * opaque data to this context. This will disable blending when compositing | 36 * opaque data to this context. This will disable blending when compositing |
38 * the plugin with the web page, which will give slightly higher performance. | 37 * the plugin with the web page, which will give slightly higher performance. |
39 * | 38 * |
40 * If you set is_always_opaque, your alpha channel should always be set to | 39 * If you set is_always_opaque, your alpha channel should always be set to |
41 * 0xFF or there may be painting artifacts. Being opaque will allow the | 40 * 0xFF or there may be painting artifacts. Being opaque will allow the |
42 * browser to do a memcpy rather than a blend to paint the plugin, and this | 41 * browser to do a memcpy rather than a blend to paint the plugin, and this |
43 * means your alpha values will get set on the page backing store. If these | 42 * means your alpha values will get set on the page backing store. If these |
44 * values are incorrect, it could mess up future blending. | 43 * values are incorrect, it could mess up future blending. |
45 * | 44 * |
46 * If you aren't sure, it is always correct to specify that it it not opaque. | 45 * If you aren't sure, it is always correct to specify that it it not opaque. |
47 */ | 46 */ |
48 PP_Resource (*Create)(PP_Module module, | 47 PP_Resource (*Create)(PP_Instance instance, |
49 const struct PP_Size* size, | 48 const struct PP_Size* size, |
50 PP_Bool is_always_opaque); | 49 PP_Bool is_always_opaque); |
51 | 50 |
52 /** | 51 /** |
53 * Returns PP_TRUE if the given resource is a valid Graphics2D, PP_FALSE if it | 52 * Returns PP_TRUE if the given resource is a valid Graphics2D, PP_FALSE if it |
54 * is an invalid resource or is a resource of another type. | 53 * is an invalid resource or is a resource of another type. |
55 */ | 54 */ |
56 PP_Bool (*IsGraphics2D)(PP_Resource resource); | 55 PP_Bool (*IsGraphics2D)(PP_Resource resource); |
57 | 56 |
58 /** | 57 /** |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 struct PP_CompletionCallback callback); | 216 struct PP_CompletionCallback callback); |
218 | 217 |
219 }; | 218 }; |
220 | 219 |
221 /** | 220 /** |
222 * @} | 221 * @} |
223 * End addtogroup PPB | 222 * End addtogroup PPB |
224 */ | 223 */ |
225 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */ | 224 #endif /* PPAPI_C_PPB_GRAPHICS_2D_H_ */ |
226 | 225 |
OLD | NEW |