From 1752c724fea3adf94db6920fa112abb4e45dc0a8 Mon Sep 17 00:00:00 2001 From: Ryan Nystrom Date: Tue, 3 Feb 2015 19:53:59 -0800 Subject: [PATCH] Respect opacity of ASImageNode fixes #284 --- AsyncDisplayKit/ASImageNode.mm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index bae53bc488..b73f822ac8 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -184,12 +184,6 @@ CGSize imageSizeInPixels = CGSizeMake(imageSize.width * image.scale, imageSize.height * image.scale); CGSize boundsSizeInPixels = CGSizeMake(floorf(bounds.size.width * contentsScale), floorf(bounds.size.height * contentsScale)); - CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(image.CGImage); - BOOL imageHasAlpha = alphaInfo == kCGImageAlphaFirst - || alphaInfo == kCGImageAlphaLast - || alphaInfo == kCGImageAlphaPremultipliedFirst - || alphaInfo == kCGImageAlphaPremultipliedLast; - BOOL contentModeSupported = contentMode == UIViewContentModeScaleAspectFill || contentMode == UIViewContentModeScaleAspectFit || contentMode == UIViewContentModeCenter; @@ -226,7 +220,7 @@ // Use contentsScale of 1.0 and do the contentsScale handling in boundsSizeInPixels so ASCroppedImageBackingSizeAndDrawRectInBounds // will do its rounding on pixel instead of point boundaries - UIGraphicsBeginImageContextWithOptions(backingSize, !imageHasAlpha, 1.0); + UIGraphicsBeginImageContextWithOptions(backingSize, parameters.opaque, 1.0); CGContextRef context = UIGraphicsGetCurrentContext();