| OLD | NEW |
| (Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From private/ppb_graphics_2d_private.idl, |
| 7 * modified Thu Jun 14 16:30:59 2012. |
| 8 */ |
| 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPB_GRAPHICS_2D_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPB_GRAPHICS_2D_PRIVATE_H_ |
| 12 |
| 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_macros.h" |
| 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_size.h" |
| 18 #include "ppapi/c/pp_stdint.h" |
| 19 |
| 20 #define PPB_GRAPHICS2D_PRIVATE_INTERFACE_0_1 "PPB_Graphics2D_Private;0.1" |
| 21 #define PPB_GRAPHICS2D_PRIVATE_INTERFACE PPB_GRAPHICS2D_PRIVATE_INTERFACE_0_1 |
| 22 |
| 23 /** |
| 24 * @file |
| 25 * This file contains the <code>PPB_Graphics2D_Private</code> interface. */ |
| 26 |
| 27 |
| 28 /** |
| 29 * @addtogroup Interfaces |
| 30 * @{ |
| 31 */ |
| 32 /* PPB_Graphics2D_Private interface */ |
| 33 struct PPB_Graphics2D_Private_0_1 { |
| 34 /** |
| 35 * Create() creates a 2D graphics context. The returned graphics context will |
| 36 * not be bound to the module instance on creation (call BindGraphics() on |
| 37 * the module instance to bind the returned graphics context to the module |
| 38 * instance). |
| 39 * |
| 40 * @param[in] instance The module instance. |
| 41 * @param[in] size The size of the graphic context. |
| 42 * @param[in] is_always_opaque Set the <code>is_always_opaque</code> flag to |
| 43 * <code>PP_TRUE</code> if you know that you will be painting only opaque |
| 44 * data to this context. This option will disable blending when compositing |
| 45 * the module with the web page, which might give higher performance on some |
| 46 * computers. |
| 47 * |
| 48 * If you set <code>is_always_opaque</code>, your alpha channel should always |
| 49 * be set to 0xFF or there may be painting artifacts. The alpha values |
| 50 * overwrite the destination alpha values without blending when |
| 51 * <code>is_always_opaque</code> is true. |
| 52 * |
| 53 * @param[in] scale The scaling factor between pixels in this context and |
| 54 * DIPs. For rendering at device resolution, this will typically be equal to |
| 55 * the device scale of the view resource passed to DidChangeView. |
| 56 * For example, if the view resource passed to DidChangeView has a rectangle |
| 57 * of (w=200, h=100) and a device scale of 2.0, one would call Create with a |
| 58 * size of (w=400, h=200) and a scaler of 2.0 then treat each pixel in the |
| 59 * context as a single device pixel. |
| 60 * |
| 61 * @return A <code>PP_Resource</code> containing the 2D graphics context if |
| 62 * successful or 0 if unsuccessful. |
| 63 */ |
| 64 PP_Resource (*Create)(PP_Instance instance, |
| 65 const struct PP_Size* size, |
| 66 PP_Bool is_always_opaque, |
| 67 float scale); |
| 68 }; |
| 69 |
| 70 typedef struct PPB_Graphics2D_Private_0_1 PPB_Graphics2D_Private; |
| 71 /** |
| 72 * @} |
| 73 */ |
| 74 |
| 75 #endif /* PPAPI_C_PRIVATE_PPB_GRAPHICS_2D_PRIVATE_H_ */ |
| 76 |
| OLD | NEW |