diff options
author | 2015-03-18 11:11:19 -0700 | |
---|---|---|
committer | 2015-03-18 11:11:19 -0700 | |
commit | eed039b5ffbdff958053ac80b09451ad6caa1787 (patch) | |
tree | 231161cc1da391effd685a5b69aeb6259c7b8d1d /src/codec/SkCodec_libpng.cpp | |
parent | c88e11508739f53514228f1ea487af3d7eef7f3e (diff) |
Adding swizzles for bmp:
We now support kN32 and kRGB_565 color types.
Additionally, we support premul, unpremul, and opaque alpha types.
Unpremul is currently untested as we cannot currently draw to unpremul.
BUG=skia:
Review URL: https://codereview.chromium.org/1013743003
Diffstat (limited to 'src/codec/SkCodec_libpng.cpp')
-rw-r--r-- | src/codec/SkCodec_libpng.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp index bf0647dd24..57653e74df 100644 --- a/src/codec/SkCodec_libpng.cpp +++ b/src/codec/SkCodec_libpng.cpp @@ -347,19 +347,19 @@ SkPngCodec::~SkPngCodec() { // Getting the pixels /////////////////////////////////////////////////////////////////////////////// -static bool conversion_possible(const SkImageInfo& A, const SkImageInfo& B) { +static bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) { // TODO: Support other conversions - if (A.colorType() != B.colorType()) { + if (dst.colorType() != src.colorType()) { return false; } - if (A.profileType() != B.profileType()) { + if (dst.profileType() != src.profileType()) { return false; } - if (A.alphaType() == B.alphaType()) { + if (dst.alphaType() == src.alphaType()) { return true; } - return premul_and_unpremul(A.alphaType(), B.alphaType()) - || premul_and_unpremul(B.alphaType(), A.alphaType()); + return kPremul_SkAlphaType == dst.alphaType() && + kUnpremul_SkAlphaType == src.alphaType(); } SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, |