aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-29 20:12:38 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-06-29 20:12:38 +0000
commitcd88d7c233f7854e14d5ee8fbf6eedb0e45f2014 (patch)
tree1fccfd240bc23f685e85f11d656b4b5cc9f687fe
parent0a09eef79053f93a9b2311c6a29275abf39f189e (diff)
Don't use the CreateWithData variant: not needed, and isn't available in chrome
git-svn-id: http://skia.googlecode.com/svn/trunk@1763 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/utils/mac/SkCreateCGImageRef.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index d41de18ad7..4a098b1864 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -196,12 +196,13 @@ bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output) {
size_t bitsPerComponent;
CGBitmapInfo info;
getBitmapInfo(bitmap, &bitsPerComponent, &info, NULL);
-
- CGContextRef ctx = CGBitmapContextCreateWithData(bitmap.getPixels(),
- w, h, bitsPerComponent,
- bitmap.rowBytes(),
- CGColorSpaceCreateDeviceRGB(),
- info, NULL, NULL);
+
+ CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
+ CGContextRef ctx = CGBitmapContextCreate(bitmap.getPixels(), w, h,
+ bitsPerComponent, bitmap.rowBytes(),
+ cs, info);
+ CGColorSpaceRelease(cs);
+
if (ctx) {
CGContextDrawPDFPage(ctx, page);
CGContextRelease(ctx);