Index: src/ports/SkImageDecoder_CG.cpp |
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp |
index 9b93f81112d51e624470f3b4a5f9bcd1a77b5b91..beb6ed11e49b8645ac9f64c290f88613647daf5f 100644 |
--- a/src/ports/SkImageDecoder_CG.cpp |
+++ b/src/ports/SkImageDecoder_CG.cpp |
@@ -50,17 +50,6 @@ protected: |
virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode); |
}; |
-// Returns an unpremultiplied version of color. It will have the same ordering and size as an |
-// SkPMColor, but the alpha will not be premultiplied. |
-static SkPMColor unpremultiply_pmcolor(SkPMColor color) { |
- U8CPU a = SkGetPackedA32(color); |
- const SkUnPreMultiply::Scale scale = SkUnPreMultiply::GetScale(a); |
- return SkPackARGB32NoCheck(a, |
- SkUnPreMultiply::ApplyScale(scale, SkGetPackedR32(color)), |
- SkUnPreMultiply::ApplyScale(scale, SkGetPackedG32(color)), |
- SkUnPreMultiply::ApplyScale(scale, SkGetPackedB32(color))); |
-} |
- |
#define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast) |
bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
@@ -118,7 +107,7 @@ bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
for (int i = 0; i < width; ++i) { |
for (int j = 0; j < height; ++j) { |
uint32_t* addr = bm->getAddr32(i, j); |
- *addr = unpremultiply_pmcolor(*addr); |
+ *addr = SkUnPreMultiply::UnPreMultiplyPreservingByteOrder(*addr); |
} |
} |
bm->setAlphaType(kUnpremul_SkAlphaType); |