Index: include/codec/SkCodec.h |
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
index 67ccdb241c3225e35e09ef2b75d1fd60bbd64a6b..b38dcd6953c648ccc7774a71400506033c1c2ddd 100644 |
--- a/include/codec/SkCodec.h |
+++ b/include/codec/SkCodec.h |
@@ -286,7 +286,7 @@ public: |
* FIXME: see skbug.com/3582. |
*/ |
bool reallyHasAlpha() const { |
- return this->onReallyHasAlpha(); |
+ return kOpaque_SkAlphaType != this->getInfo().alphaType() && this->onReallyHasAlpha(); |
} |
/** |
@@ -486,7 +486,13 @@ protected: |
return false; |
} |
- virtual bool onReallyHasAlpha() const { return false; } |
+ virtual bool onReallyHasAlpha() const { |
+ // If the image indicates that it does have alpha, by default, we |
scroggo
2015/12/10 18:45:44
Maybe add a comment that this is only called if th
msarett
2015/12/10 18:53:30
Done and yes.
|
+ // will assume this to be true. Subclasses may override this |
+ // function if they intend to verify that the image actually has |
+ // alpha. |
+ return true; |
+ } |
/** |
* If the stream was previously read, attempt to rewind. |