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

Unified Diff: src/codec/SkCodec.cpp

Issue 1530933003: Use possible read_partial_scanlines() API in SkJpegCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments and further testing Created 5 years 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 | « gyp/libjpeg-turbo.gyp ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec.cpp
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index 87a7ded7dd6bd2e0c0a6da19de1d9782a50553c3..f2b8ff4f43e025c0f8bd3cb05995449d56f9b19f 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -356,23 +356,28 @@ void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
const int linesRemaining = linesRequested - linesDecoded;
SkSampler* sampler = this->getSampler(false);
+ int fillWidth = info.width();
+ if (fOptions.fSubset) {
+ fillWidth = fOptions.fSubset->width();
+ }
+
switch (this->getScanlineOrder()) {
case kTopDown_SkScanlineOrder:
case kNone_SkScanlineOrder: {
- const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemaining);
+ const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining);
fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes);
fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler);
break;
}
case kBottomUp_SkScanlineOrder: {
fillDst = dst;
- const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemaining);
+ const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining);
fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler);
break;
}
case kOutOfOrder_SkScanlineOrder: {
SkASSERT(1 == linesRequested || this->getInfo().height() == linesRequested);
- const SkImageInfo fillInfo = info.makeWH(info.width(), 1);
+ const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * rowBytes);
fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler);
« no previous file with comments | « gyp/libjpeg-turbo.gyp ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698