add isAlphaOnly() query

BUG=skia:5904
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2461773002

TBR=

Review-Url: https://codereview.chromium.org/2461773002
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 09f7ecc..986fdec 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -371,6 +371,10 @@
     return as_IB(this)->onIsLazyGenerated();
 }
 
+bool SkImage::isAlphaOnly() const {
+    return as_IB(this)->onImageInfo().colorType() == kAlpha_8_SkColorType;
+}
+
 //////////////////////////////////////////////////////////////////////////////////////
 
 #if !SK_SUPPORT_GPU