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

Unified Diff: dm/DMSrcSink.cpp

Issue 1230033004: Allow creating multiple scanline decoders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Progressive scanline decoder needs to handle rewind on first call. 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 | « bench/subset/SubsetZoomBench.cpp ('k') | include/codec/SkCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index f7daad7b63f89032f5366c6bd7bcd5aa3ef37e92..38597b6946994c06d8cc24971dc018163ff41b14 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -158,8 +158,8 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
break;
}
case kScanline_Mode: {
- SkScanlineDecoder* scanlineDecoder = codec->getScanlineDecoder(decodeInfo, NULL,
- colorPtr, colorCountPtr);
+ SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(codec->getScanlineDecoder(
+ decodeInfo, NULL, colorPtr, colorCountPtr));
if (NULL == scanlineDecoder) {
return Error::Nonfatal("Cannot use scanline decoder for all images");
}
@@ -220,8 +220,8 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
subsetHeight + extraY : subsetHeight;
const int y = row * subsetHeight;
//create scanline decoder for each subset
- SkScanlineDecoder* subsetScanlineDecoder = codec->getScanlineDecoder(decodeInfo,
- NULL, colorPtr, colorCountPtr);
+ SkAutoTDelete<SkScanlineDecoder> subsetScanlineDecoder(
+ codec->getScanlineDecoder(decodeInfo, NULL, colorPtr, colorCountPtr));
if (NULL == subsetScanlineDecoder) {
if (x == 0 && y == 0) {
//first try, image may not be compatible
@@ -287,8 +287,8 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
const int numStripes = (height + stripeHeight - 1) / stripeHeight;
// Decode odd stripes
- SkScanlineDecoder* decoder = codec->getScanlineDecoder(decodeInfo, NULL, colorPtr,
- colorCountPtr);
+ SkAutoTDelete<SkScanlineDecoder> decoder(
+ codec->getScanlineDecoder(decodeInfo, NULL, colorPtr, colorCountPtr));
if (NULL == decoder) {
return Error::Nonfatal("Cannot use scanline decoder for all images");
}
@@ -321,7 +321,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
}
// Decode even stripes
- decoder = codec->getScanlineDecoder(decodeInfo, NULL, colorPtr, colorCountPtr);
+ decoder.reset(codec->getScanlineDecoder(decodeInfo, NULL, colorPtr, colorCountPtr));
if (NULL == decoder) {
return "Failed to create second scanline decoder.";
}
« no previous file with comments | « bench/subset/SubsetZoomBench.cpp ('k') | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698