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

Unified Diff: src/codec/SkJpegCodec.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 | « src/codec/SkCodec_wbmp.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.h
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h
index 38e41e757cbe82334cb845d313cc54bd2ede1c68..b86396317b90bd848a77a1c6ec6b35726d574745 100644
--- a/src/codec/SkJpegCodec.h
+++ b/src/codec/SkJpegCodec.h
@@ -18,8 +18,6 @@ extern "C" {
#include "jpeglib.h"
}
-class SkScanlineDecoder;
-
/*
*
* This class implements the decoding for jpeg images
@@ -41,13 +39,6 @@ public:
*/
static SkCodec* NewFromStream(SkStream*);
- /*
- * Assumes IsJpeg was called and returned true
- * Creates a jpeg scanline decoder
- * Takes ownership of the stream
- */
- static SkScanlineDecoder* NewSDFromStream(SkStream*);
-
protected:
/*
@@ -102,6 +93,8 @@ private:
*/
SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream, JpegDecoderMgr* decoderMgr);
+ ~SkJpegCodec() override;
+
/*
* Checks if the conversion between the input image and the requested output
* image has been implemented
@@ -115,13 +108,23 @@ private:
*/
bool nativelyScaleToDimensions(uint32_t width, uint32_t height);
+ // scanline decoding
+ Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&);
+ Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
+ SkPMColor ctable[], int* ctableCount) override;
+ Result onGetScanlines(void* dst, int count, size_t rowBytes) override;
+ Result onSkipScanlines(int count) override;
+
SkAutoTDelete<JpegDecoderMgr> fDecoderMgr;
// We will save the state of the decompress struct after reading the header.
// This allows us to safely call onGetScaledDimensions() at any time.
const int fReadyState;
-
- friend class SkJpegScanlineDecoder;
+ // scanline decoding
+ SkAutoMalloc fStorage; // Only used if sampling is needed
+ uint8_t* fSrcRow; // Only used if sampling is needed
+ SkAutoTDelete<SkSwizzler> fSwizzler;
+
typedef SkCodec INHERITED;
};
« no previous file with comments | « src/codec/SkCodec_wbmp.cpp ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698