Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: src/image/SkImage.cpp

Issue 2461773002: add isAlphaOnly() query (Closed)
Patch Set: add test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 09f7ecc4cf61f5fa4cebb234ebd7d081f89462b1..986fdec3a42dfa919fa9a4079c0e187597877130 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -371,6 +371,10 @@ bool SkImage::isLazyGenerated() const {
return as_IB(this)->onIsLazyGenerated();
}
+bool SkImage::isAlphaOnly() const {
+ return as_IB(this)->onImageInfo().colorType() == kAlpha_8_SkColorType;
+}
+
//////////////////////////////////////////////////////////////////////////////////////
#if !SK_SUPPORT_GPU

Powered by Google App Engine
This is Rietveld 408576698