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

Unified Diff: src/codec/SkBmpRLECodec.h

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Scanline decoding for bmp without reordering 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/SkBmpRLECodec.h
diff --git a/src/codec/SkBmpRLECodec.h b/src/codec/SkBmpRLECodec.h
index ee8989be64d78861b2c62a9ea7b02f86d75f64d0..3b0ebfa88436c5dff11b98e1bb86d47b1f085b29 100644
--- a/src/codec/SkBmpRLECodec.h
+++ b/src/codec/SkBmpRLECodec.h
@@ -35,9 +35,9 @@ public:
* after decoding the headers
*/
SkBmpRLECodec(const SkImageInfo& srcInfo, SkStream* stream,
- uint16_t bitsPerPixel, uint32_t numColors,
- uint32_t bytesPerColor, uint32_t offset,
- SkBmpCodec::RowOrder rowOrder, size_t RLEBytes);
+ SkBmpCodec::BmpInputFormat inputFormat, uint16_t bitsPerPixel,
+ uint32_t numColors, uint32_t bytesPerColor, uint32_t offset,
+ SkBmpCodec::RowOrder rowOrder, size_t RLEBytes);
protected:
@@ -91,5 +91,30 @@ private:
size_t fRLEBytes;
uint32_t fCurrRLEByte;
+ friend class SkBmpRLEScanlineDecoder;
+
typedef SkBmpCodec INHERITED;
};
+
+/*
+ * Scanline decoder for RLE bmps
+ */
+class SkBmpRLEScanlineDecoder : public SkScanlineDecoder {
+public:
+ SkBmpRLEScanlineDecoder(SkBmpRLECodec* codec);
+
+ SkCodec::Result onStart(const SkImageInfo& dstInfo, const SkCodec::Options& options,
+ SkPMColor inputColorPtr[], int* inputColorCount) override;
+
+ SkCodec::Result onGetScanlines(void* dst, int count, size_t rowBytes) override;
+
+ // TODO(msarett): Override default skipping with something more clever.
+ // TODO(msarett): Consider other optimizations for this codec.
+
+private:
+ SkAutoTDelete<SkBmpRLECodec> fCodec;
+ SkImageInfo fDstInfo;
+ SkCodec::Options fOpts;
+
+ typedef SkScanlineDecoder INHERITED;
+};

Powered by Google App Engine
This is Rietveld 408576698