| 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_module.h" | 9 #include "ppapi/c/pp_module.h" |
| 9 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
| 10 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
| 11 | 12 |
| 12 struct PP_CompletionCallback; | 13 struct PP_CompletionCallback; |
| 13 struct PP_Point; | 14 struct PP_Point; |
| 14 struct PP_Rect; | 15 struct PP_Rect; |
| 15 struct PP_Size; | 16 struct PP_Size; |
| 16 | 17 |
| 17 #define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.1" | 18 #define PPB_GRAPHICS_2D_INTERFACE "PPB_Graphics2D;0.2" |
| 18 | 19 |
| 19 /** | 20 /** |
| 20 * @file | 21 * @file |
| 21 * Defines the PPB_Graphics2D struct. | 22 * Defines the PPB_Graphics2D struct. |
| 22 * | 23 * |
| 23 * @addtogroup PPB | 24 * @addtogroup PPB |
| 24 * @{ | 25 * @{ |
| 25 */ | 26 */ |
| 26 | 27 |
| 27 /** {PENDING: describe PPB_Graphics2D. */ | 28 /** {PENDING: describe PPB_Graphics2D. */ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 * If you set is_always_opaque, your alpha channel should always be set to | 40 * If you set is_always_opaque, your alpha channel should always be set to |
| 40 * 0xFF or there may be painting artifacts. Being opaque will allow the | 41 * 0xFF or there may be painting artifacts. Being opaque will allow the |
| 41 * browser to do a memcpy rather than a blend to paint the plugin, and this | 42 * browser to do a memcpy rather than a blend to paint the plugin, and this |
| 42 * means your alpha values will get set on the page backing store. If these | 43 * means your alpha values will get set on the page backing store. If these |
| 43 * values are incorrect, it could mess up future blending. | 44 * values are incorrect, it could mess up future blending. |
| 44 * | 45 * |
| 45 * If you aren't sure, it is always correct to specify that it it not opaque. | 46 * If you aren't sure, it is always correct to specify that it it not opaque. |
| 46 */ | 47 */ |
| 47 PP_Resource (*Create)(PP_Module module, | 48 PP_Resource (*Create)(PP_Module module, |
| 48 const struct PP_Size* size, | 49 const struct PP_Size* size, |
| 49 bool is_always_opaque); | 50 PP_Bool is_always_opaque); |
| 50 | 51 |
| 51 /** | 52 /** |
| 52 * Returns true if the given resource is a valid Graphics2D, false if it | 53 * Returns PP_TRUE if the given resource is a valid Graphics2D, PP_FALSE if it |
| 53 * is an invalid resource or is a resource of another type. | 54 * is an invalid resource or is a resource of another type. |
| 54 */ | 55 */ |
| 55 bool (*IsGraphics2D)(PP_Resource resource); | 56 PP_Bool (*IsGraphics2D)(PP_Resource resource); |
| 56 | 57 |
| 57 /** | 58 /** |
| 58 * Retrieves the configuration for the given graphics context, filling the | 59 * Retrieves the configuration for the given graphics context, filling the |
| 59 * given values (which must not be NULL). On success, returns true. If the | 60 * given values (which must not be NULL). On success, returns PP_TRUE. If the |
| 60 * resource is invalid, the output parameters will be set to 0 and it will | 61 * resource is invalid, the output parameters will be set to 0 and it will |
| 61 * return false. | 62 * return PP_FALSE. |
| 62 */ | 63 */ |
| 63 bool (*Describe)(PP_Resource graphics_2d, | 64 PP_Bool (*Describe)(PP_Resource graphics_2d, |
| 64 struct PP_Size* size, | 65 struct PP_Size* size, |
| 65 bool* is_always_opqaue); | 66 PP_Bool* is_always_opqaue); |
| 66 | 67 |
| 67 /** | 68 /** |
| 68 * Enqueues a paint of the given image into the context. THIS HAS NO EFFECT | 69 * Enqueues a paint of the given image into the context. THIS HAS NO EFFECT |
| 69 * UNTIL YOU CALL Flush(). As a result, what counts is the contents of the | 70 * UNTIL YOU CALL Flush(). As a result, what counts is the contents of the |
| 70 * bitmap when you call Flush, not when you call this function. | 71 * bitmap when you call Flush, not when you call this function. |
| 71 * | 72 * |
| 72 * The given image will be placed at |top_left| from the top left of the | 73 * The given image will be placed at |top_left| from the top left of the |
| 73 * context's internal backing store. Then the src_rect will be copied into the | 74 * context's internal backing store. Then the src_rect will be copied into the |
| 74 * backing store. This parameter may not be NULL. | 75 * backing store. This parameter may not be NULL. |
| 75 * | 76 * |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 int32_t (*Flush)(PP_Resource graphics_2d, | 215 int32_t (*Flush)(PP_Resource graphics_2d, |
| 215 struct PP_CompletionCallback callback); | 216 struct PP_CompletionCallback callback); |
| 216 | 217 |
| 217 }; | 218 }; |
| 218 | 219 |
| 219 /** | 220 /** |
| 220 * @} | 221 * @} |
| 221 * End addtogroup PPB | 222 * End addtogroup PPB |
| 222 */ | 223 */ |
| 223 #endif // PPAPI_C_PPB_GRAPHICS_2D_H_ | 224 #endif // PPAPI_C_PPB_GRAPHICS_2D_H_ |
| OLD | NEW |