Remove some #ifdef's from SkAndroidCodec

SkSampledCodec is always defined, and if we got a codec that claims to
be one of these (PNG, ICO, JPEG, GIF, BMP, WBMP, HEIF), we should pass
it to SkSampledCodec.

Bug: skia:
Change-Id: Id2e3a1798cb5aaaf4d44f019b665b6ece463097e
Reviewed-on: https://skia-review.googlesource.com/c/168540
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This commit is contained in:
Nigel Tao 2018-11-07 12:54:21 +11:00 committed by Skia Commit-Bot
parent b5c2cf84ca
commit 9803e0c522

View File

@ -89,19 +89,13 @@ std::unique_ptr<SkAndroidCodec> SkAndroidCodec::MakeFromCodec(std::unique_ptr<Sk
}
switch ((SkEncodedImageFormat)codec->getEncodedFormat()) {
#ifdef SK_HAS_PNG_LIBRARY
case SkEncodedImageFormat::kPNG:
case SkEncodedImageFormat::kICO:
#endif
#ifdef SK_HAS_JPEG_LIBRARY
case SkEncodedImageFormat::kJPEG:
#endif
case SkEncodedImageFormat::kGIF:
case SkEncodedImageFormat::kBMP:
case SkEncodedImageFormat::kWBMP:
#ifdef SK_HAS_HEIF_LIBRARY
case SkEncodedImageFormat::kHEIF:
#endif
return skstd::make_unique<SkSampledCodec>(codec.release(), orientationBehavior);
#ifdef SK_HAS_WEBP_LIBRARY
case SkEncodedImageFormat::kWEBP: