| OLD | NEW |
| 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 "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 347 } |
| 348 | 348 |
| 349 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
Bytes, | 349 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
Bytes, |
| 350 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { | 350 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { |
| 351 | 351 |
| 352 void* fillDst; | 352 void* fillDst; |
| 353 const uint32_t fillValue = this->getFillValue(info.colorType()); | 353 const uint32_t fillValue = this->getFillValue(info.colorType()); |
| 354 const int linesRemaining = linesRequested - linesDecoded; | 354 const int linesRemaining = linesRequested - linesDecoded; |
| 355 SkSampler* sampler = this->getSampler(false); | 355 SkSampler* sampler = this->getSampler(false); |
| 356 | 356 |
| 357 int fillWidth = info.width(); |
| 358 if (fOptions.fSubset) { |
| 359 fillWidth = fOptions.fSubset->width(); |
| 360 } |
| 361 |
| 357 switch (this->getScanlineOrder()) { | 362 switch (this->getScanlineOrder()) { |
| 358 case kTopDown_SkScanlineOrder: | 363 case kTopDown_SkScanlineOrder: |
| 359 case kNone_SkScanlineOrder: { | 364 case kNone_SkScanlineOrder: { |
| 360 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); | 365 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); |
| 361 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); | 366 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); |
| 362 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 367 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
| 363 break; | 368 break; |
| 364 } | 369 } |
| 365 case kBottomUp_SkScanlineOrder: { | 370 case kBottomUp_SkScanlineOrder: { |
| 366 fillDst = dst; | 371 fillDst = dst; |
| 367 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); | 372 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); |
| 368 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 373 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
| 369 break; | 374 break; |
| 370 } | 375 } |
| 371 case kOutOfOrder_SkScanlineOrder: { | 376 case kOutOfOrder_SkScanlineOrder: { |
| 372 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); | 377 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); |
| 373 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 378 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); |
| 374 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 379 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
| 375 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); | 380 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); |
| 376 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); | 381 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); |
| 377 } | 382 } |
| 378 break; | 383 break; |
| 379 } | 384 } |
| 380 } | 385 } |
| 381 } | 386 } |
| OLD | NEW |