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

Unified Diff: include/codec/SkCodec.h

Issue 1061713007: Adding png scanline decoding to kIndex8 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ctableCount requirements Created 5 years, 8 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 | « dm/DMSrcSink.cpp ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index 6f313a1c7058715c8e7c95a82ca1448b152b245e..b3898892b09c3ce3fcaec86b2f9d87465f61cff3 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -70,6 +70,15 @@ public:
*
* @param dstInfo Info of the destination. If the dimensions do not match
* those of getInfo, this implies a scale.
+ * @param options Contains decoding options, including if memory is zero
+ * initialized.
+ * @param ctable A pointer to a color table. When dstInfo.colorType() is
+ * kIndex8, this should be non-NULL and have enough storage for 256
+ * colors. The color table will be populated after decoding the palette.
+ * @param ctableCount A pointer to the size of the color table. When
+ * dstInfo.colorType() is kIndex8, this should be non-NULL. It will
+ * be modified to the true size of the color table (<= 256) after
+ * decoding the palette.
* @return New SkScanlineDecoder, or NULL on failure.
*
* NOTE: If any rows were previously decoded, this requires rewinding the
@@ -78,6 +87,13 @@ public:
* NOTE: The scanline decoder is owned by the SkCodec and will delete it
* when the SkCodec is deleted.
*/
+ SkScanlineDecoder* getScanlineDecoder(const SkImageInfo& dstInfo, const Options* options,
djsollen 2015/04/29 14:02:58 const* for options here and const& on the protecte
scroggo 2015/04/29 14:13:22 This follows a pattern I've used elsewhere in SkCo
+ SkPMColor ctable[], int* ctableCount);
+
+ /**
+ * Simplified version of getScanlineDecoder() that asserts that info is NOT
+ * kIndex8_SkColorType and uses the default Options.
+ */
SkScanlineDecoder* getScanlineDecoder(const SkImageInfo& dstInfo);
/**
@@ -126,10 +142,22 @@ protected:
*
* @param dstInfo Info of the destination. If the dimensions do not match
* those of getInfo, this implies a scale.
+ * @param options Contains decoding options, including if memory is zero
+ * initialized.
+ * @param ctable A pointer to a color table. When dstInfo.colorType() is
+ * kIndex8, this should be non-NULL and have enough storage for 256
+ * colors. The color table will be populated after decoding the palette.
+ * @param ctableCount A pointer to the size of the color table. When
+ * dstInfo.colorType() is kIndex8, this should be non-NULL. It will
+ * be modified to the true size of the color table (<= 256) after
+ * decoding the palette.
* @return New SkScanlineDecoder on success, NULL otherwise. The SkCodec
* will take ownership of the returned scanline decoder.
*/
- virtual SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo) {
+ virtual SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo,
+ const Options& options,
+ SkPMColor ctable[],
+ int* ctableCount) {
return NULL;
}
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698