Add alphaType() to SkImage
Keep isOpaque as a convenience method -- many places really only need to
know that for optimization purposes (SrcOver -> Src, etc...).
In all the places where we pull data back out or convert to another
object and need to supply an SkImageInfo, we can avoid losing information
about premulness.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250663002
Review-Url: https://codereview.chromium.org/2250663002
diff --git a/gm/image.cpp b/gm/image.cpp
index a67ed20..400d421 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -303,8 +303,7 @@
#include "SkImageGenerator.h"
static SkImageInfo make_info(SkImage* img) {
- return SkImageInfo::MakeN32(img->width(), img->height(),
- img->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
+ return SkImageInfo::MakeN32(img->width(), img->height(), img->alphaType());
}
// Its simple, but I wonder if we should expose this formally?