Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ppapi/c/ppb_image_data.h

Issue 5674004: Add compile assertions to enforce the sizes of all structs and enums in the C... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_IMAGE_DATA_H_ 5 #ifndef PPAPI_C_PPB_IMAGE_DATA_H_
6 #define PPAPI_C_PPB_IMAGE_DATA_H_ 6 #define PPAPI_C_PPB_IMAGE_DATA_H_
7 7
8 #include "ppapi/c/pp_bool.h" 8 #include "ppapi/c/pp_bool.h"
9 #include "ppapi/c/pp_macros.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_size.h" 12 #include "ppapi/c/pp_size.h"
12 #include "ppapi/c/pp_stdint.h" 13 #include "ppapi/c/pp_stdint.h"
13 14
14 typedef enum { 15 typedef enum {
15 PP_IMAGEDATAFORMAT_BGRA_PREMUL, 16 PP_IMAGEDATAFORMAT_BGRA_PREMUL,
16 PP_IMAGEDATAFORMAT_RGBA_PREMUL 17 PP_IMAGEDATAFORMAT_RGBA_PREMUL
17 } PP_ImageDataFormat; 18 } PP_ImageDataFormat;
19 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_ImageDataFormat, 4);
18 20
19 struct PP_ImageDataDesc { 21 struct PP_ImageDataDesc {
20 PP_ImageDataFormat format; 22 PP_ImageDataFormat format;
21 23
22 // Size of the bitmap in pixels. 24 // Size of the bitmap in pixels.
23 struct PP_Size size; 25 struct PP_Size size;
24 26
25 // The row width in bytes. This may be different than width * 4 since there 27 // The row width in bytes. This may be different than width * 4 since there
26 // may be padding at the end of the lines. 28 // may be padding at the end of the lines.
27 int32_t stride; 29 int32_t stride;
28 }; 30 };
31 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ImageDataDesc, 16);
29 32
30 #define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.2" 33 #define PPB_IMAGEDATA_INTERFACE "PPB_ImageData;0.2"
31 34
32 /** 35 /**
33 * @file 36 * @file
34 * Defines the API ... 37 * Defines the API ...
35 * 38 *
36 * @addtogroup PPB 39 * @addtogroup PPB
37 * @{ 40 * @{
38 */ 41 */
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void* (*Map)(PP_Resource image_data); 94 void* (*Map)(PP_Resource image_data);
92 95
93 void (*Unmap)(PP_Resource image_data); 96 void (*Unmap)(PP_Resource image_data);
94 }; 97 };
95 98
96 /** 99 /**
97 * @} 100 * @}
98 * End addtogroup PPB 101 * End addtogroup PPB
99 */ 102 */
100 #endif // PPAPI_C_PPB_IMAGE_DATA_H_ 103 #endif // PPAPI_C_PPB_IMAGE_DATA_H_
OLDNEW
« ppapi/c/dev/pp_video_dev.h ('K') | « ppapi/c/ppb_class.h ('k') | ppapi/c/ppb_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698