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

Unified Diff: src/codec/SkWbmpCodec.cpp

Issue 1996993003: Finish supporting decoding opaque to non-opaque (Closed) Base URL: https://skia.googlesource.com/skia.git@opaque
Patch Set: Add tests Created 4 years, 7 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/SkWbmpCodec.cpp
diff --git a/src/codec/SkWbmpCodec.cpp b/src/codec/SkWbmpCodec.cpp
index 527565f6ab4484152f78909583b60400cacfccff..326fc2206a082b6d6bd6d897d8f4cce12c11c1fd 100644
--- a/src/codec/SkWbmpCodec.cpp
+++ b/src/codec/SkWbmpCodec.cpp
@@ -30,15 +30,14 @@ static inline void setup_color_table(SkColorType colorType,
}
}
-static inline bool valid_color_type(SkColorType colorType, SkAlphaType alphaType) {
+static inline bool valid_color_type(SkColorType colorType) {
switch (colorType) {
case kRGBA_8888_SkColorType:
case kBGRA_8888_SkColorType:
case kIndex_8_SkColorType:
- return true;
case kGray_8_SkColorType:
case kRGB_565_SkColorType:
- return kOpaque_SkAlphaType == alphaType;
+ return true;
default:
return false;
}
@@ -128,7 +127,7 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
return kUnimplemented;
}
- if (!valid_color_type(info.colorType(), info.alphaType()) ||
+ if (!valid_color_type(info.colorType()) ||
!valid_alpha(info.alphaType(), this->getInfo().alphaType())) {
return kInvalidConversion;
}
@@ -196,7 +195,7 @@ SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
return kUnimplemented;
}
- if (!valid_color_type(dstInfo.colorType(), dstInfo.alphaType()) ||
+ if (!valid_color_type(dstInfo.colorType()) ||
!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) {
return kInvalidConversion;
}
« dm/DMSrcSink.cpp ('K') | « src/codec/SkCodecPriv.h ('k') | tests/CodecTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698