diff options
author | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 01:01:52 +0000 |
---|---|---|
committer | amanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 01:01:52 +0000 |
commit | 8860e4f513e757810afecfb62a2bd282cd731ed9 (patch) | |
tree | a1905994c55ee794c1e4d3e450ba009f8d5f65f1 /skia/ext/bitmap_platform_device_mac.cc | |
parent | 2d896aedfc2630ee7a7c973e84d69f5099104767 (diff) | |
download | chromium_src-8860e4f513e757810afecfb62a2bd282cd731ed9.zip chromium_src-8860e4f513e757810afecfb62a2bd282cd731ed9.tar.gz chromium_src-8860e4f513e757810afecfb62a2bd282cd731ed9.tar.bz2 |
Update WebKit to 45111 and Skia to 239
Review URL: http://codereview.chromium.org/147121
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/bitmap_platform_device_mac.cc')
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index fd8a3a8..60293d8 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -47,6 +47,10 @@ bool Constrain(int available_size, int* position, int *size) { static CGContextRef CGContextForData(void* data, int width, int height) { CGColorSpaceRef color_space = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); +#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, 16, 8, 0) // Allocate a bitmap context with 4 components per pixel (BGRA). Apple // recommends these flags for improved CG performance. CGContextRef context = @@ -54,6 +58,11 @@ static CGContextRef CGContextForData(void* data, int width, int height) { color_space, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); +#else +#error We require that Skia's and CoreGraphics's recommended \ + image memory layout match. +#endif +#undef HAS_ARGB_SHIFTS CGColorSpaceRelease(color_space); if (!context) |