aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkCodec_libpng.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-10-13 12:50:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-13 12:50:14 -0700
commitfdb47571a3b5e72469b67de44e32ac14d9352ab4 (patch)
treecc98e7952e756c3c8825e7f9af3b280b3fc7b449 /src/codec/SkCodec_libpng.cpp
parenteb85b8321bc917169ba26c8fce76b64d2e3dfe81 (diff)
Add subsetting to SkScanlineDecoder
This CL allows the SkScanlineDecoder to decode partial scanlines. This is a first step in efficiently implementing subsetting in SkScaledCodec. BUG=skia:4209 Review URL: https://codereview.chromium.org/1390213002
Diffstat (limited to 'src/codec/SkCodec_libpng.cpp')
-rw-r--r--src/codec/SkCodec_libpng.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index e828e24999..7d41623a88 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -435,8 +435,7 @@ SkCodec::Result SkPngCodec::initializeSwizzler(const SkImageInfo& requestedInfo,
// Create the swizzler. SkPngCodec retains ownership of the color table.
const SkPMColor* colors = get_color_ptr(fColorTable.get());
- fSwizzler.reset(SkSwizzler::CreateSwizzler(fSrcConfig, colors, requestedInfo,
- options.fZeroInitialized));
+ fSwizzler.reset(SkSwizzler::CreateSwizzler(fSrcConfig, colors, requestedInfo, options));
if (!fSwizzler) {
// FIXME: CreateSwizzler could fail for another reason.
return kUnimplemented;
@@ -477,8 +476,7 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
}
// Note that ctable and ctableCount may be modified if there is a color table
- const Result result = this->initializeSwizzler(requestedInfo, options,
- ctable, ctableCount);
+ const Result result = this->initializeSwizzler(requestedInfo, options, ctable, ctableCount);
if (result != kSuccess) {
return result;
}
@@ -699,15 +697,14 @@ public:
}
Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
- SkPMColor ctable[], int* ctableCount) override
- {
+ SkPMColor ctable[], int* ctableCount) override {
if (!conversion_possible(dstInfo, this->getInfo())) {
return kInvalidConversion;
}
- const SkCodec::Result result = this->initializeSwizzler(dstInfo, options, ctable,
- ctableCount);
- if (result != SkCodec::kSuccess) {
+ const Result result = this->initializeSwizzler(dstInfo, options, ctable,
+ ctableCount);
+ if (result != kSuccess) {
return result;
}