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

Unified Diff: Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp

Issue 9689079: Merge 110499 - [Skia] Release CGImage used to apply color space conversion to SkBitmap (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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 | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
===================================================================
--- Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp (revision 110586)
+++ Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp (working copy)
@@ -119,7 +119,7 @@
{
int width = bitmap.width();
int height = bitmap.height();
- CGImageRef srcImage = SkCreateCGImageRefWithColorspace(bitmap, colorSpace);
+ RetainPtr<CGImageRef> srcImage(AdoptCF, SkCreateCGImageRefWithColorspace(bitmap, colorSpace));
SkAutoLockPixels lock(bitmap);
void* pixels = bitmap.getPixels();
RetainPtr<CGContextRef> cgBitmap(AdoptCF, CGBitmapContextCreate(pixels, width, height, 8, width * 4, deviceRGBColorSpaceRef(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst));
@@ -127,7 +127,7 @@
return;
CGContextSetBlendMode(cgBitmap.get(), kCGBlendModeCopy);
CGRect bounds = { {0, 0}, {width, height} };
- CGContextDrawImage(cgBitmap.get(), bounds, srcImage);
+ CGContextDrawImage(cgBitmap.get(), bounds, srcImage.get());
}
static CGColorSpaceRef createColorSpace(const ColorProfile& colorProfile)
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698