Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: src/codec/SkCodec_libpng.cpp

Issue 1013743003: Adding premul and 565 swizzles for bmp: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Trybot fixes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/codec/SkCodec_libpng.cpp
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index bf0647dd24aeca259738708644782c8ace2db3be..57653e74df30b44f379a755a2640f2030b3162a1 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,

Powered by Google App Engine
This is Rietveld 408576698