aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-18 21:24:16 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-18 21:24:16 +0000
commit05ea1810a231b1f699c98a0b6272e08a4c93b06b (patch)
tree92ad9de84157c532511c27ab4ae15d433b4a8ee2
parent9d7576724cf9602ff778b18126e0fef0ab3d3bf2 (diff)
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
-rw-r--r--include/core/SkColorPriv.h20
-rw-r--r--include/core/SkPostConfig.h19
2 files changed, 20 insertions, 19 deletions
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h
index f9e02a29c7..6fa9df365d 100644
--- a/include/core/SkColorPriv.h
+++ b/include/core/SkColorPriv.h
@@ -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)
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 57cc3682f5..a34fdb4c91 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -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