aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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);