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

Unified Diff: src/utils/mac/SkCreateCGImageRef.cpp

Issue 18024003: ARM Skia NEON patches - 08 - Cleaning / possible fix (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDevice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/mac/SkCreateCGImageRef.cpp
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index e9e1107ff65ed71d3bf305dc84cb8a004bb04b6d..e931901b396b118cd3e377cc237999c79d7abad8 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -14,10 +14,6 @@ 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 bool getBitmapInfo(const SkBitmap& bm,
size_t* bitsPerComponent,
CGBitmapInfo* info,
@@ -34,16 +30,14 @@ static bool getBitmapInfo(const SkBitmap& bm,
// fall through
case SkBitmap::kARGB_8888_Config:
*bitsPerComponent = 8;
-#if defined(SK_CPU_LENDIAN) && HAS_ARGB_SHIFTS(24, 0, 8, 16) \
-|| defined(SK_CPU_BENDIAN) && HAS_ARGB_SHIFTS(0, 24, 16, 8)
+#if SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
*info = kCGBitmapByteOrder32Big;
if (bm.isOpaque()) {
*info |= kCGImageAlphaNoneSkipLast;
} else {
*info |= kCGImageAlphaPremultipliedLast;
}
-#elif defined(SK_CPU_LENDIAN) && HAS_ARGB_SHIFTS(24, 16, 8, 0) \
-|| defined(SK_CPU_BENDIAN) && HAS_ARGB_SHIFTS(24, 16, 8, 0)
+#elif SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
// Matches the CGBitmapInfo that Apple recommends for best
// performance, used by google chrome.
*info = kCGBitmapByteOrder32Little;
@@ -108,8 +102,6 @@ static SkBitmap* prepareForImageRef(const SkBitmap& bm,
return copy;
}
-#undef HAS_ARGB_SHIFTS
-
CGImageRef SkCreateCGImageRefWithColorspace(const SkBitmap& bm,
CGColorSpaceRef colorSpace) {
size_t bitsPerComponent SK_INIT_TO_AVOID_WARNING;
« no previous file with comments | « src/core/SkDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698