diff options
author | 2014-07-08 11:15:59 -0700 | |
---|---|---|
committer | 2014-07-08 11:15:59 -0700 | |
commit | be08aceaab724b21136d7654fa86315850e9993c (patch) | |
tree | 85dd2b0a2f17697ccdb5d3ba5933594e596a6151 /include | |
parent | 65b6fa177798089a3556643f765fbbca5a4a5185 (diff) |
add setPreserveSrcDepth to replace PrefTable API for android
BUG=skia:
R=scroggo@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/371273007
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImageDecoder.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h index b73c4ff261..b258afedce 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 override that, causing the codec to try to match the src depth instead + * (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; |