Index: src/ports/SkImageDecoder_CG.cpp |
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp |
index eb2b46a080f72455100d6b16162e78cff8c22004..ba16e4b45c0e53f8e952a5713ae497d0d22b5d4f 100644 |
--- a/src/ports/SkImageDecoder_CG.cpp |
+++ b/src/ports/SkImageDecoder_CG.cpp |
@@ -157,7 +157,18 @@ SkImageDecoder::Result SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* b |
} |
} |
- bm->setInfo(SkImageInfo::MakeN32Premul(width, height, cpType)); |
+ SkAlphaType at = kPremul_SkAlphaType; |
+ switch (CGImageGetAlphaInfo(image)) { |
+ case kCGImageAlphaNone: |
+ case kCGImageAlphaNoneSkipLast: |
+ case kCGImageAlphaNoneSkipFirst: |
+ at = kOpaque_SkAlphaType; |
+ break; |
+ default: |
+ break; |
+ } |
+ |
+ bm->setInfo(SkImageInfo::Make(width, height, kN32_SkColorType, at, cpType)); |
if (SkImageDecoder::kDecodeBounds_Mode == mode) { |
return kSuccess; |
} |