Finish supporting decoding opaque to non-opaque

When decoding to 565 or Gray, allow the client to incorrectly ask for premul.

When checking whether it's possible to decode to 565, return whether the
source is opaque.

In DM, allow decoding to 565 or Gray, even if the client also asked for premul.

This fixes a bug introduced in crrev.com/1999593003 when we stopped ever
requesting Opaque, resulting in us not testing 565 or Gray.

BUG=skia:4616
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1996993003

Review-Url: https://codereview.chromium.org/1996993003
diff --git a/src/codec/SkWbmpCodec.cpp b/src/codec/SkWbmpCodec.cpp
index 527565f..326fc22 100644
--- a/src/codec/SkWbmpCodec.cpp
+++ b/src/codec/SkWbmpCodec.cpp
@@ -30,15 +30,14 @@
     }
 }
 
-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 @@
         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 @@
         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;
     }