move SHIFT default definitions from SkColorPriv.h to SkPostConfig.h, so that

clients don't accidentally see them defined on some platforms when they only
include SkTypes.h, and not others.



git-svn-id: http://skia.googlecode.com/svn/trunk@1373 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-05-18 21:24:16 +00:00
parent 9d7576724c
commit 05ea1810a2
2 changed files with 20 additions and 19 deletions

View File

@ -155,31 +155,13 @@ static inline void SkBlendRGB16(const uint16_t src[], uint16_t dst[],
#define SkRGB16Add(a, b) ((a) + (b))
#endif
/////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#define SK_A32_BITS 8
#define SK_R32_BITS 8
#define SK_G32_BITS 8
#define SK_B32_BITS 8
/* we check to see if the SHIFT value has already been defined (SkUserConfig.h)
if not, we define it ourself to some default values. We default to OpenGL
order (in memory: r,g,b,a)
*/
#ifndef SK_A32_SHIFT
#ifdef SK_CPU_BENDIAN
#define SK_R32_SHIFT 24
#define SK_G32_SHIFT 16
#define SK_B32_SHIFT 8
#define SK_A32_SHIFT 0
#else
#define SK_R32_SHIFT 0
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 16
#define SK_A32_SHIFT 24
#endif
#endif
#define SK_A32_MASK ((1 << SK_A32_BITS) - 1)
#define SK_R32_MASK ((1 << SK_R32_BITS) - 1)
#define SK_G32_MASK ((1 << SK_G32_BITS) - 1)

View File

@ -63,6 +63,25 @@
#endif
#endif
/*
* We check to see if the SHIFT value has already been defined.
* if not, we define it ourself to some default values. We default to OpenGL
* order (in memory: r,g,b,a)
*/
#ifndef SK_A32_SHIFT
#ifdef SK_CPU_BENDIAN
#define SK_R32_SHIFT 24
#define SK_G32_SHIFT 16
#define SK_B32_SHIFT 8
#define SK_A32_SHIFT 0
#else
#define SK_R32_SHIFT 0
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 16
#define SK_A32_SHIFT 24
#endif
#endif
///////////////////////////////////////////////////////////////////////////////
#ifndef SkNEW