Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding.

This is the bug in early version of Image/IO framework, but now it's already been fixed and duplicated process impact performance
This commit is contained in:
DreamPiggy 2018-04-25 15:54:17 +08:00
parent 5f85848aaa
commit 8f49d753b4
1 changed files with 0 additions and 19 deletions

View File

@ -150,25 +150,6 @@
// Create the image // Create the image
CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL); CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL);
#if SD_UIKIT || SD_WATCH
// Workaround for iOS anamorphic image
if (partialImageRef) {
const size_t partialHeight = CGImageGetHeight(partialImageRef);
CGColorSpaceRef colorSpace = [SDWebImageCoderHelper colorSpaceGetDeviceRGB];
CGContextRef bmContext = CGBitmapContextCreate(NULL, _width, _height, 8, 0, colorSpace, kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
if (bmContext) {
CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = _width, .size.height = partialHeight}, partialImageRef);
CGImageRelease(partialImageRef);
partialImageRef = CGBitmapContextCreateImage(bmContext);
CGContextRelease(bmContext);
}
else {
CGImageRelease(partialImageRef);
partialImageRef = nil;
}
}
#endif
if (partialImageRef) { if (partialImageRef) {
CGFloat scale = _scale; CGFloat scale = _scale;
if ([options valueForKey:SDWebImageCoderDecodeScaleFactor]) { if ([options valueForKey:SDWebImageCoderDecodeScaleFactor]) {