encode kAlpha_8 as grayalpha with sigbits for gray==1
Bug: skia:
Change-Id: Ib61e8e0f62af92d8746f5e73469002e7804a8447
Reviewed-on: https://skia-review.googlesource.com/78481
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index 59978c6..a0f1fb2 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -175,6 +175,10 @@
case kGray_8_SkColorType:
return SkEncodedInfo::kGray_Color == srcColor && srcIsOpaque &&
!needs_color_xform(dst, srcCS, false);
+ case kAlpha_8_SkColorType:
+ // conceptually we can convert anything into alpha_8, but we haven't actually coded
+ // all of those other conversions yet, so only return true for the case we have codec.
+ return fSrcInfo.colorType() == kAlpha_8_SkColorType;;
default:
return false;
}