OLD | NEW |
1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright 2013 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_SIMPLE_PS_CONTEXT_2D_H_ | 5 #ifndef PPAPI_SIMPLE_PS_CONTEXT_2D_H_ |
6 #define PPAPI_SIMPLE_PS_CONTEXT_2D_H_ | 6 #define PPAPI_SIMPLE_PS_CONTEXT_2D_H_ |
7 | 7 |
8 #include "ppapi/c/pp_resource.h" | 8 #include "ppapi/c/pp_resource.h" |
9 #include "ppapi/c/ppb_graphics_2d.h" | 9 #include "ppapi/c/ppb_graphics_2d.h" |
10 #include "ppapi/c/ppb_image_data.h" | 10 #include "ppapi/c/ppb_image_data.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 } PSContext2D_t; | 27 } PSContext2D_t; |
28 | 28 |
29 | 29 |
30 /* | 30 /* |
31 * PSContext2DAllocate | 31 * PSContext2DAllocate |
32 * | 32 * |
33 * Allocate or free a 2D context object which the library can use to perform | 33 * Allocate or free a 2D context object which the library can use to perform |
34 * various PPAPI operations on the developer's behalf, such as processing view | 34 * various PPAPI operations on the developer's behalf, such as processing view |
35 * change events, swapping buffers, etc... | 35 * change events, swapping buffers, etc... |
36 */ | 36 */ |
37 PSContext2D_t* PSContext2DAllocate(); | 37 PSContext2D_t* PSContext2DAllocate(PP_ImageDataFormat format); |
38 void PSContext2DFree(PSContext2D_t* ctx); | 38 void PSContext2DFree(PSContext2D_t* ctx); |
39 | 39 |
40 /* | 40 /* |
| 41 * PSContext2DGetNativeFormat |
| 42 * |
| 43 * Query the native system image format. |
| 44 */ |
| 45 PP_ImageDataFormat PSContext2DGetNativeImageDataFormat(); |
| 46 |
| 47 /* |
41 * PSContext2DHandleEvent | 48 * PSContext2DHandleEvent |
42 * | 49 * |
43 * Updates the context such as allocating, freeing, or sizing graphics and | 50 * Updates the context such as allocating, freeing, or sizing graphics and |
44 * image resources in response to events. | 51 * image resources in response to events. |
45 */ | 52 */ |
46 int PSContext2DHandleEvent(PSContext2D_t* ctx, PSEvent* event); | 53 int PSContext2DHandleEvent(PSContext2D_t* ctx, PSEvent* event); |
47 | 54 |
48 /* | 55 /* |
49 * PSContext2DGetBuffer | 56 * PSContext2DGetBuffer |
50 * | 57 * |
51 * Points the data member of the context to the raw pixels of the image for | 58 * Points the data member of the context to the raw pixels of the image for |
52 * writing to the screen. The image will become visible after a swap. | 59 * writing to the screen. The image will become visible after a swap. |
53 */ | 60 */ |
54 int PSContext2DGetBuffer(PSContext2D_t* ctx); | 61 int PSContext2DGetBuffer(PSContext2D_t* ctx); |
55 | 62 |
56 /* | 63 /* |
57 * PSContext2DSwapBuffer | 64 * PSContext2DSwapBuffer |
58 * | 65 * |
59 * Swaps out the currently visible graphics with the data stored in the image | 66 * Swaps out the currently visible graphics with the data stored in the image |
60 * buffer making it visible. The old image resource will no longer be | 67 * buffer making it visible. The old image resource will no longer be |
61 * available after this call. | 68 * available after this call. |
62 */ | 69 */ |
63 int PSContext2DSwapBuffer(PSContext2D_t* ctx); | 70 int PSContext2DSwapBuffer(PSContext2D_t* ctx); |
64 | 71 |
65 EXTERN_C_END | 72 EXTERN_C_END |
66 | 73 |
67 #endif /* PPAPI_SIMPLE_PS_CONTEXT_2D_H_ */ | 74 #endif /* PPAPI_SIMPLE_PS_CONTEXT_2D_H_ */ |
OLD | NEW |