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

Unified Diff: src/codec/SkCodec.cpp

Issue 1719073002: Use new jpeg_crop_scanlines() API to optimize jpeg subset decodes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add to assert Created 4 years, 10 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 | « gyp/codec.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 c4f7498f7947da2ec93c4d485e764117c065ecee..d7cfb3749708f04e4f3d2adba765c82205dce4f3 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -354,23 +354,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/codec.gyp ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698