Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: include/core/SkImageDecoder.h

Issue 371273007: add setPreserveSrcDepth to replace PrefTable API for android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/images/SkImageDecoder.cpp » ('j') | src/images/SkImageDecoder.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageDecoder.h
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index b73c4ff261496cca36851bf4b64eb23c214ad46f..fb5fbce60dea5196e877edb5eb9a82512ae492fc 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -205,6 +205,21 @@ 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
+ * from a peeker to change that, causing the codec to try to match the
scroggo 2014/07/08 17:31:07 The only caller is from a Peeker (I suppose so tha
reed1 2014/07/08 17:41:24 Done.
+ * src depth instead (as shown below). This is a replacement for calling
+ * setPrefConfigTable().
scroggo 2014/07/08 17:31:07 Do we really need this reference to a deprecated (
reed1 2014/07/08 17:41:24 Done.
+ *
+ * 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 +471,7 @@ private:
PrefConfigTable fPrefTable; // use if fUsePrefTable is true
bool fUsePrefTable;
#endif
+ bool fPreserveSrcDepth;
bool fDitherImage;
bool fSkipWritingZeroes;
mutable bool fShouldCancelDecode;
« no previous file with comments | « no previous file | src/images/SkImageDecoder.cpp » ('j') | src/images/SkImageDecoder.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698