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

Unified Diff: src/codec/SkBmpCodec.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
« no previous file with comments | « no previous file | src/codec/SkBmpCodec.cpp » ('j') | src/codec/SkBmpCodec.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkBmpCodec.h
diff --git a/src/codec/SkBmpCodec.h b/src/codec/SkBmpCodec.h
index 71006f73153ea3028529b0c51daa999b498bc86e..8a5066b4f49917547176499731c1b6fccab3813f 100644
--- a/src/codec/SkBmpCodec.h
+++ b/src/codec/SkBmpCodec.h
@@ -11,6 +11,7 @@
#include "SkColorTable.h"
#include "SkImageInfo.h"
#include "SkMaskSwizzler.h"
+#include "SkScanlineDecoder.h"
#include "SkStream.h"
#include "SkSwizzler.h"
#include "SkTypes.h"
@@ -31,6 +32,16 @@ public:
};
/*
+ * Used to define the input format of the bmp
+ */
+ enum BmpInputFormat {
+ kStandard_BmpInputFormat,
+ kRLE_BmpInputFormat,
+ kBitMask_BmpInputFormat,
+ kUnknown_BmpInputFormat
+ };
+
+ /*
* Checks the start of the stream to see if the image is a bmp
*/
static bool IsBmp(SkStream*);
@@ -48,10 +59,17 @@ public:
*/
static SkCodec* NewFromIco(SkStream*);
+ /*
+ * Assumes IsBmp was called and returned true
+ * Creates a bmp scanline decoder
+ * Takes ownership of the stream
+ */
+ static SkScanlineDecoder* NewSDFromStream(SkStream* stream);
+
protected:
- SkBmpCodec(const SkImageInfo& info, SkStream* stream, uint16_t bitsPerPixel,
- RowOrder rowOrder);
+ SkBmpCodec(const SkImageInfo& info, SkStream* stream, BmpInputFormat inputFormat,
+ uint16_t bitsPerPixel, RowOrder rowOrder);
SkEncodedFormat onGetEncodedFormat() const override { return kBMP_SkEncodedFormat; }
@@ -104,8 +122,9 @@ private:
*/
static SkCodec* NewFromStream(SkStream*, bool inIco);
- const uint16_t fBitsPerPixel;
- const RowOrder fRowOrder;
+ const BmpInputFormat fInputFormat;
+ const uint16_t fBitsPerPixel;
+ const RowOrder fRowOrder;
typedef SkCodec INHERITED;
};
« no previous file with comments | « no previous file | src/codec/SkBmpCodec.cpp » ('j') | src/codec/SkBmpCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698