| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 381 |
| 382 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
Bytes, | 382 void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
Bytes, |
| 383 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { | 383 ZeroInitialized zeroInit, int linesRequested, int linesDecoded) { |
| 384 | 384 |
| 385 void* fillDst; | 385 void* fillDst; |
| 386 const uint64_t fillValue = this->getFillValue(info); | 386 const uint64_t fillValue = this->getFillValue(info); |
| 387 const int linesRemaining = linesRequested - linesDecoded; | 387 const int linesRemaining = linesRequested - linesDecoded; |
| 388 SkSampler* sampler = this->getSampler(false); | 388 SkSampler* sampler = this->getSampler(false); |
| 389 | 389 |
| 390 int fillWidth = info.width(); | 390 int fillWidth = info.width(); |
| 391 if (fOptions.fSubset) { | |
| 392 fillWidth = fOptions.fSubset->width(); | |
| 393 } | |
| 394 | |
| 395 switch (this->getScanlineOrder()) { | 391 switch (this->getScanlineOrder()) { |
| 396 case kTopDown_SkScanlineOrder: | 392 case kTopDown_SkScanlineOrder: |
| 397 case kNone_SkScanlineOrder: { | 393 case kNone_SkScanlineOrder: { |
| 398 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); | 394 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); |
| 399 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); | 395 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); |
| 400 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 396 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
| 401 break; | 397 break; |
| 402 } | 398 } |
| 403 case kBottomUp_SkScanlineOrder: { | 399 case kBottomUp_SkScanlineOrder: { |
| 404 fillDst = dst; | 400 fillDst = dst; |
| 405 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); | 401 const SkImageInfo fillInfo = info.makeWH(fillWidth, linesRemaining); |
| 406 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 402 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
| 407 break; | 403 break; |
| 408 } | 404 } |
| 409 case kOutOfOrder_SkScanlineOrder: { | 405 case kOutOfOrder_SkScanlineOrder: { |
| 410 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); | 406 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); |
| 411 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); | 407 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); |
| 412 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 408 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
| 413 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); | 409 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); |
| 414 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); | 410 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); |
| 415 } | 411 } |
| 416 break; | 412 break; |
| 417 } | 413 } |
| 418 } | 414 } |
| 419 } | 415 } |
| OLD | NEW |