create a macro for testing if skcolor and skpmcolor have same shift values

R=reed@google.com

Review URL: https://codereview.chromium.org/22799015

git-svn-id: http://skia.googlecode.com/svn/trunk@10838 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
djsollen@google.com 2013-08-20 20:28:03 +00:00
parent 6364b5edc3
commit 2b343cc255

View File

@ -206,6 +206,14 @@
#endif
#endif
/**
* SkColor has well defined shift values, but SkPMColor is configurable. This
* macro is a convenience that returns true if the shift values are equal while
* ignoring the machine's endianness.
*/
#define SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER \
(SK_A32_SHIFT == 24 && SK_R32_SHIFT == 16 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 0)
/**
* SK_PMCOLOR_BYTE_ORDER can be used to query the byte order of SkPMColor at compile time. The
* relationship between the byte order and shift values depends on machine endianness. If the shift