Chromium Code Reviews| Index: include/codec/SkAndroidCodec.h |
| diff --git a/include/codec/SkAndroidCodec.h b/include/codec/SkAndroidCodec.h |
| index f979886a43ec33c573de3553b49651a8a06d7025..bc3a58a08cd0d972f7ddb43e0fa5cd4692b67d36 100644 |
| --- a/include/codec/SkAndroidCodec.h |
| +++ b/include/codec/SkAndroidCodec.h |
| @@ -208,6 +208,18 @@ public: |
| */ |
| SkCodec::Result getAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); |
| + /** |
| + * Some images may initially report that they have alpha due to the format |
| + * of the encoded data, but then never use any colors which have alpha |
| + * less than 100%. This function can be called *after* decoding to |
| + * determine if such an image truly had alpha. Calling it before decoding |
| + * is undefined. |
| + * FIXME: see skbug.com/3582. |
| + */ |
| + bool reallyHasAlpha() const { |
|
scroggo
2015/12/10 17:02:32
With some changes, this doesn't even need to be vi
msarett
2015/12/10 17:41:18
I went halfway there. Can we save the actualCodec
scroggo
2015/12/10 18:29:42
fine with me
|
| + return this->onReallyHasAlpha(); |
| + } |
| + |
| protected: |
| SkAndroidCodec(const SkImageInfo&); |
| @@ -221,6 +233,8 @@ protected: |
| virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, |
| size_t rowBytes, const AndroidOptions& options) = 0; |
| + virtual bool onReallyHasAlpha() const = 0; |
| + |
| private: |
| // This will always be a reference to the info that is contained by the |