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

Unified Diff: src/codec/SkJpegCodec.h

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Forgot to add SkSampler.cpp Created 5 years, 2 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/SkJpegCodec.h
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h
index 6377c9d4692bb1271eae31ca1f060322b9f1c2a0..2b4b946109efb8518f5070d79d975c39b2233e43 100644
--- a/src/codec/SkJpegCodec.h
+++ b/src/codec/SkJpegCodec.h
@@ -50,7 +50,7 @@ protected:
* Initiates the jpeg decode
*/
Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, const Options&,
- SkPMColor*, int*) override;
+ SkPMColor*, int*, int*) override;
SkEncodedFormat onGetEncodedFormat() const override {
return kJPEG_SkEncodedFormat;
@@ -106,13 +106,17 @@ private:
SkSampler* getSampler() override;
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;
+ int onGetScanlines(void* dst, int count, size_t rowBytes) override;
+ bool 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;
+ // We need to keep track of the requested info, so we can provide a valid
+ // sampler if necessary. A sampler may be used for a sampled decode or
+ // to fill incomplete images.
+ SkImageInfo fDstInfo;
scroggo 2015/10/07 16:04:24 Isn't there an accessor on the base class?
msarett 2015/10/07 17:40:41 Yeah but this->dstInfo() is invalid when we call o
// scanline decoding
SkAutoMalloc fStorage; // Only used if sampling is needed

Powered by Google App Engine
This is Rietveld 408576698