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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « gyp/libjpeg-turbo.gyp ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 349 }
350 350
351 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row Bytes, 351 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row Bytes,
352 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { 352 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) {
353 353
354 void* fillDst; 354 void* fillDst;
355 const uint32_t fillValue = this->getFillValue(info.colorType(), info.alphaTy pe()); 355 const uint32_t fillValue = this->getFillValue(info.colorType(), info.alphaTy pe());
356 const int linesRemaining = linesRequested - linesDecoded; 356 const int linesRemaining = linesRequested - linesDecoded;
357 SkSampler* sampler = this->getSampler(false); 357 SkSampler* sampler = this->getSampler(false);
358 358
359 int fillWidth = info.width();
360 if (fOptions.fSubset) {
361 fillWidth = fOptions.fSubset->width();
362 }
363
359 switch (this->getScanlineOrder()) { 364 switch (this->getScanlineOrder()) {
360 case kTopDown_SkScanlineOrder: 365 case kTopDown_SkScanlineOrder:
361 case kNone_SkScanlineOrder: { 366 case kNone_SkScanlineOrder: {
362 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin g); 367 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining);
363 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); 368 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes);
364 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler) ; 369 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler) ;
365 break; 370 break;
366 } 371 }
367 case kBottomUp_SkScanlineOrder: { 372 case kBottomUp_SkScanlineOrder: {
368 fillDst = dst; 373 fillDst = dst;
369 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin g); 374 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining);
370 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler) ; 375 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler) ;
371 break; 376 break;
372 } 377 }
373 case kOutOfOrder_SkScanlineOrder: { 378 case kOutOfOrder_SkScanlineOrder: {
374 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 379 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
375 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); 380 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
376 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 381 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
377 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 382 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
378 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 383 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
379 } 384 }
380 break; 385 break;
381 } 386 }
382 } 387 }
383 } 388 }
OLDNEW
« 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