Chromium Code Reviews| Index: include/codec/SkCodec.h |
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
| index 67ccdb241c3225e35e09ef2b75d1fd60bbd64a6b..02d4469ba66049aae9aeac86b7c233e67a854b32 100644 |
| --- a/include/codec/SkCodec.h |
| +++ b/include/codec/SkCodec.h |
| @@ -486,7 +486,13 @@ protected: |
| return false; |
| } |
| - virtual bool onReallyHasAlpha() const { return false; } |
| + virtual bool onReallyHasAlpha() const { |
| + // Opaque images never have alpha. If the image indicates that it |
| + // does have alpha, by default, we will assume this to be true. |
| + // Subclasses may override this function if they intend to verify |
| + // that the image actually has alpha. |
| + return kOpaque_SkAlphaType != this->getInfo().alphaType(); |
|
scroggo
2015/12/10 17:02:32
SkWebpCodec's implementation looks like this (and
msarett
2015/12/10 17:41:18
Yes I think so. Or we should make this pure virtu
scroggo
2015/12/10 18:29:42
Yeah, I think we have a note about that in skbug.c
|
| + } |
| /** |
| * If the stream was previously read, attempt to rewind. |