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

Unified Diff: skia/config/SkUserConfig.h

Issue 141037: Get our color channels straight. The reason why the color swap was required... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: ... Created 11 years, 6 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 | « chrome/browser/cocoa/cocoa_utils_unittest.mm ('k') | skia/ext/bitmap_platform_device_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/config/SkUserConfig.h
===================================================================
--- skia/config/SkUserConfig.h (revision 18890)
+++ skia/config/SkUserConfig.h (working copy)
@@ -166,11 +166,15 @@
#define SK_CPU_LENDIAN
#undef SK_CPU_BENDIAN
-// we want (memory order) RGBA
+// we want (memory order) BGRA, because that's what core image uses with
+// kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, which is what
+// Apple recommends for best performance (ARGB becomes BGRA in memory on
+// little-endian) -- and we want skia and coregraphic to have matching memory
+// layouts, so that we don't have to spend time converting between them.
#define SK_A32_SHIFT 24
-#define SK_R32_SHIFT 0
+#define SK_R32_SHIFT 16
#define SK_G32_SHIFT 8
-#define SK_B32_SHIFT 16
+#define SK_B32_SHIFT 0
#elif defined(SK_BUILD_FOR_UNIX)
« no previous file with comments | « chrome/browser/cocoa/cocoa_utils_unittest.mm ('k') | skia/ext/bitmap_platform_device_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698