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

Unified Diff: src/codec/SkBmpCodec.h

Issue 1365313002: Merge SkCodec with SkScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Skip ICO in SkScaledCodec for now Created 5 years, 3 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 | « resources/plane_interlaced.png ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »
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 4b2cd2a268b7c523a233853c46f9d03993d21333..ea6f789407cdab7ad15d5543bcdac516de8c5893 100644
--- a/src/codec/SkBmpCodec.h
+++ b/src/codec/SkBmpCodec.h
@@ -11,7 +11,6 @@
#include "SkColorTable.h"
#include "SkImageInfo.h"
#include "SkMaskSwizzler.h"
-#include "SkScanlineDecoder.h"
#include "SkStream.h"
#include "SkSwizzler.h"
#include "SkTypes.h"
@@ -41,17 +40,10 @@ 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,
- SkScanlineDecoder::SkScanlineOrder rowOrder);
+ SkCodec::SkScanlineOrder rowOrder);
SkEncodedFormat onGetEncodedFormat() const override { return kBMP_SkEncodedFormat; }
@@ -87,7 +79,7 @@ protected:
* when we want to decode the full or one when we are
* sampling.
*/
- int32_t getDstRow(int32_t y, int32_t height);
+ int32_t getDstRow(int32_t y, int32_t height) const;
/*
* Get the destination row to start filling from
@@ -107,7 +99,7 @@ protected:
* Accessors used by subclasses
*/
uint16_t bitsPerPixel() const { return fBitsPerPixel; }
- SkScanlineDecoder::SkScanlineOrder rowOrder() const { return fRowOrder; }
+ SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; }
/*
* To be overriden by bmp subclasses, which provide unique implementations.
@@ -153,10 +145,17 @@ private:
virtual Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
const Options& opts) = 0;
- const uint16_t fBitsPerPixel;
- const SkScanlineDecoder::SkScanlineOrder fRowOrder;
+ Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Options&,
+ SkPMColor inputColorPtr[], int* inputColorCount) override;
+
+ Result onGetScanlines(void* dst, int count, size_t rowBytes) override;
+
+ int onNextScanline() const override;
+
+ // TODO(msarett): Override default skipping with something more clever.
- friend class SkBmpScanlineDecoder;
+ const uint16_t fBitsPerPixel;
+ const SkScanlineOrder fRowOrder;
typedef SkCodec INHERITED;
};
« no previous file with comments | « resources/plane_interlaced.png ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698