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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1220733013: SkCodec no longer inherits from SkImageGenerator. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Manually handle the lifetime of fScanlineDecoder. Created 5 years, 5 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/SkSwizzler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 5e24b17848339fedfb90b3a0d3c1198bc391849b..858e305b067132b78dd25bd03403090eadd6d2e5 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -11,6 +11,7 @@
#include "SkJpegUtility_codec.h"
#include "SkCodecPriv.h"
#include "SkColorPriv.h"
+#include "SkScanlineDecoder.h"
#include "SkStream.h"
#include "SkTemplates.h"
#include "SkTypes.h"
@@ -407,10 +408,10 @@ public:
, fCodec(codec)
{}
- SkImageGenerator::Result onGetScanlines(void* dst, int count, size_t rowBytes) override {
+ SkCodec::Result onGetScanlines(void* dst, int count, size_t rowBytes) override {
// Set the jump location for libjpeg errors
if (setjmp(fCodec->fDecoderMgr->getJmpBuf())) {
- return fCodec->fDecoderMgr->returnFailure("setjmp", SkImageGenerator::kInvalidInput);
+ return fCodec->fDecoderMgr->returnFailure("setjmp", SkCodec::kInvalidInput);
}
// Read rows one at a time
@@ -423,7 +424,7 @@ public:
SkSwizzler::Fill(
dstRow, this->dstInfo(), rowBytes, count - y, SK_ColorBLACK, NULL);
fCodec->fDecoderMgr->dinfo()->output_scanline = this->dstInfo().height();
- return SkImageGenerator::kIncompleteInput;
+ return SkCodec::kIncompleteInput;
}
// Convert to RGBA if necessary
@@ -435,7 +436,7 @@ public:
dstRow = SkTAddOffset<JSAMPLE>(dstRow, rowBytes);
}
- return SkImageGenerator::kSuccess;
+ return SkCodec::kSuccess;
}
#ifndef TURBO_HAS_SKIP
@@ -447,15 +448,15 @@ public:
}
#endif
- SkImageGenerator::Result onSkipScanlines(int count) override {
+ SkCodec::Result onSkipScanlines(int count) override {
// Set the jump location for libjpeg errors
if (setjmp(fCodec->fDecoderMgr->getJmpBuf())) {
- return fCodec->fDecoderMgr->returnFailure("setjmp", SkImageGenerator::kInvalidInput);
+ return fCodec->fDecoderMgr->returnFailure("setjmp", SkCodec::kInvalidInput);
}
turbo_jpeg_skip_scanlines(fCodec->fDecoderMgr->dinfo(), count);
- return SkImageGenerator::kSuccess;
+ return SkCodec::kSuccess;
}
private:
« no previous file with comments | « src/codec/SkCodec_wbmp.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698