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

Unified Diff: src/codec/SkCodec_wbmp.h

Issue 1254483004: Scanline decoding for wbmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More minor fixes Created 5 years, 4 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/SkCodec_wbmp.h
diff --git a/src/codec/SkCodec_wbmp.h b/src/codec/SkCodec_wbmp.h
index fece249728e72e1f2d0fcd0700981a84a116a8da..cec398d34b8e036a9574b4d09d6d046fa278be20 100644
--- a/src/codec/SkCodec_wbmp.h
+++ b/src/codec/SkCodec_wbmp.h
@@ -9,17 +9,53 @@
#define SkCodec_wbmp_DEFINED
#include "SkCodec.h"
+#include "SkScanlineDecoder.h"
+#include "SkSwizzler.h"
class SkWbmpCodec final : public SkCodec {
public:
static bool IsWbmp(SkStream*);
+
+ /*
+ * Assumes IsWbmp was called and returned true
+ * Creates a wbmp codec
+ * Takes ownership of the stream
+ */
static SkCodec* NewFromStream(SkStream*);
+
+ /*
+ * Assumes IsWbmp was called and returned true
+ * Creates a wbmp scanline decoder
+ * Takes ownership of the stream
+ */
+ static SkScanlineDecoder* NewSDFromStream(SkStream*);
protected:
SkEncodedFormat onGetEncodedFormat() const override;
Result onGetPixels(const SkImageInfo&, void*, size_t,
const Options&, SkPMColor[], int*) override;
private:
+
+ /*
+ * Calls rewindIfNeeded and returns true if the decoder can continue
+ */
+ bool handleRewind();
+
+ /*
+ * Returns a swizzler on success, NULL on failure
+ */
+ SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* ctable,
+ const Options& opts);
+
+ /*
+ * Read a src row from the encoded stream
+ */
+ Result readRow(uint8_t* row);
+
SkWbmpCodec(const SkImageInfo&, SkStream*);
+
+ const size_t fSrcRowBytes;
+
+ friend class SkWbmpScanlineDecoder;
typedef SkCodec INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698