diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-29 17:07:19 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-06-29 17:07:19 +0000 |
commit | a545a5598e59c22c529e5f33964df1ddd6601ac2 (patch) | |
tree | 2247a9bae2c4dc8a222e7f1f7d367fca412713b3 /src/utils | |
parent | 4516f4786f5dda1b86a8f825b9e8e910d9c2363c (diff) |
fix config check to include SkColorPriv.h so we don't get the warning w/o need
git-svn-id: http://skia.googlecode.com/svn/trunk@245 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/mac/SkCreateCGImageRef.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp index dca0175188..be53f00040 100644 --- a/src/utils/mac/SkCreateCGImageRef.cpp +++ b/src/utils/mac/SkCreateCGImageRef.cpp @@ -1,5 +1,6 @@ #include "SkCGUtils.h" #include "SkBitmap.h" +#include "SkColorPriv.h" extern CGImageRef SkCreateCGImageRef(const SkBitmap&); @@ -8,21 +9,23 @@ static void SkBitmap_ReleaseInfo(void* info, const void* pixelData, size_t size) delete bitmap; } +#define HAS_ARGB_SHIFTS(a, r, g, b) \ + (SK_A32_SHIFT == (a) && SK_R32_SHIFT == (r) \ + && SK_G32_SHIFT == (g) && SK_B32_SHIFT == (b)) + static SkBitmap* prepareForImageRef(const SkBitmap& bm, size_t* bitsPerComponent, CGBitmapInfo* info) { +#if 0 + SkDebugf("---- %d %d %d %d\n", SK_A32_SHIFT, SK_R32_SHIFT, + SK_G32_SHIFT, SK_B32_SHIFT); +#endif + switch (bm.config()) { case SkBitmap::kARGB_8888_Config: *bitsPerComponent = 8; - // try to match our rgba ordering in SkColorPriv, but take into - // account that the data layout could have been overridden in - // SkUserConfig. -#define HAS_ARGB_SHIFTS(a, r, g, b) \ - (SK_A32_SHIFT == (a) && SK_R32_SHIFT == (r) \ - && SK_G32_SHIFT == (g) && SK_B32_SHIFT == (b)) #if defined(SK_CPU_LENDIAN) && HAS_ARGB_SHIFTS(24, 0, 8, 16) \ || defined(SK_CPU_BENDIAN) && HAS_ARGB_SHIFTS(0, 24, 16, 8) - // The default rgba ordering from SkColorPriv.h *info = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast; #elif defined(SK_CPU_LENDIAN) && HAS_ARGB_SHIFTS(24, 16, 8, 0) \ @@ -40,7 +43,6 @@ static SkBitmap* prepareForImageRef(const SkBitmap& bm, *info = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast; #endif -#undef HAS_ARGB_SHIFTS break; case SkBitmap::kRGB_565_Config: // doesn't see quite right. Are they thinking 1555? @@ -58,6 +60,8 @@ static SkBitmap* prepareForImageRef(const SkBitmap& bm, return new SkBitmap(bm); } +#undef HAS_ARGB_SHIFTS + CGImageRef SkCreateCGImageRef(const SkBitmap& bm) { size_t bitsPerComponent; CGBitmapInfo info; |