Chromium Code Reviews| Index: include/core/SkImageDecoder.h |
| diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h |
| index b73c4ff261496cca36851bf4b64eb23c214ad46f..1c21285f3ef08d8674e0fc470421c69ad5ac1d9e 100644 |
| --- a/include/core/SkImageDecoder.h |
| +++ b/include/core/SkImageDecoder.h |
| @@ -205,6 +205,20 @@ public: |
| void resetPrefConfigTable() { fUsePrefTable = false; } |
| #endif |
| + /** |
| + * By default, the codec will try to comply with the "pref" colortype |
| + * that is passed to decode() or decodeSubset(). However, this can be called |
| + * to change that, causing the codec to try to match the src depth instead |
|
scroggo
2014/07/08 17:46:02
nit: maybe this should be "override" instead of "c
reed1
2014/07/08 17:48:48
Done.
|
| + * (as shown below). |
| + * |
| + * src_8Index -> kIndex_8_SkColorType |
| + * src_8Gray -> kN32_SkColorType |
| + * src_8bpc -> kN32_SkColorType |
| + */ |
| + void setPreserveSrcDepth(bool preserve) { |
| + fPreserveSrcDepth = preserve; |
| + } |
| + |
| SkBitmap::Allocator* getAllocator() const { return fAllocator; } |
| SkBitmap::Allocator* setAllocator(SkBitmap::Allocator*); |
| @@ -456,6 +470,7 @@ private: |
| PrefConfigTable fPrefTable; // use if fUsePrefTable is true |
| bool fUsePrefTable; |
| #endif |
| + bool fPreserveSrcDepth; |
| bool fDitherImage; |
| bool fSkipWritingZeroes; |
| mutable bool fShouldCancelDecode; |