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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 sampler->fill(info, dst, rowBytes, colorOrIndex, zeroInit); | 345 sampler->fill(info, dst, rowBytes, colorOrIndex, zeroInit); |
346 } else { | 346 } else { |
347 SkSampler::Fill(info, dst, rowBytes, colorOrIndex, zeroInit); | 347 SkSampler::Fill(info, dst, rowBytes, colorOrIndex, zeroInit); |
348 } | 348 } |
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()); |
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 switch (this->getScanlineOrder()) { | 359 switch (this->getScanlineOrder()) { |
360 case kTopDown_SkScanlineOrder: | 360 case kTopDown_SkScanlineOrder: |
361 case kNone_SkScanlineOrder: { | 361 case kNone_SkScanlineOrder: { |
362 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); | 362 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); |
363 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); | 363 fillDst = SkTAddOffset<void>(dst, linesDecoded * rowBytes); |
364 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 364 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
365 break; | 365 break; |
366 } | 366 } |
367 case kBottomUp_SkScanlineOrder: { | 367 case kBottomUp_SkScanlineOrder: { |
368 fillDst = dst; | 368 fillDst = dst; |
369 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); | 369 const SkImageInfo fillInfo = info.makeWH(info.width(), linesRemainin
g); |
370 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; | 370 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler)
; |
371 break; | 371 break; |
372 } | 372 } |
373 case kOutOfOrder_SkScanlineOrder: { | 373 case kOutOfOrder_SkScanlineOrder: { |
374 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); | 374 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); |
375 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 375 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); |
376 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 376 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
377 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); | 377 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); |
378 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); | 378 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); |
379 } | 379 } |
380 break; | 380 break; |
381 } | 381 } |
382 } | 382 } |
383 } | 383 } |
OLD | NEW |