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

Side by Side Diff: include/core/SkPostConfig.h

Issue 22799015: create a macro for testing if skcolor and skpmcolor have same shift values (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkPostConfig_DEFINED 10 #ifndef SkPostConfig_DEFINED
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 #define SK_B32_SHIFT 8 199 #define SK_B32_SHIFT 8
200 #define SK_A32_SHIFT 0 200 #define SK_A32_SHIFT 0
201 #else 201 #else
202 #define SK_R32_SHIFT 0 202 #define SK_R32_SHIFT 0
203 #define SK_G32_SHIFT 8 203 #define SK_G32_SHIFT 8
204 #define SK_B32_SHIFT 16 204 #define SK_B32_SHIFT 16
205 #define SK_A32_SHIFT 24 205 #define SK_A32_SHIFT 24
206 #endif 206 #endif
207 #endif 207 #endif
208 208
209 #define SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER \
210 (SK_A32_SHIFT == 24 && SK_R32_SHIFT == 16 && SK_G32_SHIFT == 8 && SK_B32_SHI FT == 0)
211
209 /** 212 /**
210 * SK_PMCOLOR_BYTE_ORDER can be used to query the byte order of SkPMColor at com pile time. The 213 * SK_PMCOLOR_BYTE_ORDER can be used to query the byte order of SkPMColor at com pile time. The
211 * relationship between the byte order and shift values depends on machine endia nness. If the shift 214 * relationship between the byte order and shift values depends on machine endia nness. If the shift
212 * order is R=0, G=8, B=16, A=24 then ((char*)&pmcolor)[0] will produce the R ch annel on a little 215 * order is R=0, G=8, B=16, A=24 then ((char*)&pmcolor)[0] will produce the R ch annel on a little
213 * endian machine and the A channel on a big endian machine. Thus, given those s hifts values, 216 * endian machine and the A channel on a big endian machine. Thus, given those s hifts values,
214 * SK_PMCOLOR_BYTE_ORDER(R,G,B,A) will be true on a little endian machine and 217 * SK_PMCOLOR_BYTE_ORDER(R,G,B,A) will be true on a little endian machine and
215 * SK_PMCOLOR_BYTE_ORDER(A,B,G,R) will be true on a big endian machine. 218 * SK_PMCOLOR_BYTE_ORDER(A,B,G,R) will be true on a big endian machine.
216 */ 219 */
217 #ifdef SK_CPU_BENDIAN 220 #ifdef SK_CPU_BENDIAN
218 #define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \ 221 #define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 #else 387 #else
385 #define SK_SIZE_T_SPECIFIER "%zu" 388 #define SK_SIZE_T_SPECIFIER "%zu"
386 #endif 389 #endif
387 #endif 390 #endif
388 391
389 ////////////////////////////////////////////////////////////////////// 392 //////////////////////////////////////////////////////////////////////
390 393
391 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 394 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
392 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1 395 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1
393 #endif 396 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698