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

Unified Diff: src/codec/SkSwizzler.h

Issue 1010903003: Add scanline decoding to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanups Created 5 years, 9 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
Index: src/codec/SkSwizzler.h
diff --git a/src/codec/SkSwizzler.h b/src/codec/SkSwizzler.h
index 0bf2ee306a9377c64e5691260b2e9272ea853e06..cd5ba4757c4a852d151caf9c51e8128b38c17daa 100644
--- a/src/codec/SkSwizzler.h
+++ b/src/codec/SkSwizzler.h
@@ -18,6 +18,7 @@ public:
* Enum describing the config of the source data.
*/
enum SrcConfig {
+ kUnknown, // Invalid type.
kGray, // 1 byte per pixel
kIndex, // 1 byte per pixel
kRGB, // 3 bytes per pixel
@@ -64,6 +65,17 @@ public:
* @return Whether the row had non-opaque alpha.
*/
bool next(const uint8_t* SK_RESTRICT src);
+
+ /**
+ * Update the destination row.
+ *
+ * Typically this is done by next, but for a client that wants to manually
+ * modify the destination row (for example, for decoding scanline one at a
+ * time) they can call this before each call to next.
+ * TODO: Maybe replace this with a version of next which allows supplying the
+ * destination?
+ */
+ void setDstRow(void* dst) { fDstRow = dst; }
private:
/**
* Method for converting raw data to Skia pixels.

Powered by Google App Engine
This is Rietveld 408576698