summaryrefslogtreecommitdiffstats
path: root/skia/ext/bitmap_platform_device_mac.cc
diff options
context:
space:
mode:
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.cc')
-rwxr-xr-xskia/ext/bitmap_platform_device_mac.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index b338c9f..f544684 100755
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -169,10 +169,13 @@ BitmapPlatformDeviceMac* BitmapPlatformDeviceMac::Create(CGContextRef context,
CGColorSpaceRef color_space =
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
- // allocate a bitmap context with 4 components per pixel (RGBA):
+ // allocate a bitmap context with 4 components per pixel (BGRA). Apple
+ // recommends these flags for improved CG performance.
CGContextRef bitmap_context =
CGBitmapContextCreate(data, width, height, 8, width*4,
- color_space, kCGImageAlphaPremultipliedLast);
+ color_space,
+ kCGImageAlphaPremultipliedFirst |
+ kCGBitmapByteOrder32Host);
// Change the coordinate system to match WebCore's
CGContextTranslateCTM(bitmap_context, 0, height);