| 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 "SkBmpMaskCodec.h" | 8 #include "SkBmpMaskCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 {} | 23 {} |
| 24 | 24 |
| 25 /* | 25 /* |
| 26 * Initiates the bitmap decode | 26 * Initiates the bitmap decode |
| 27 */ | 27 */ |
| 28 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, | 28 SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo, |
| 29 void* dst, size_t dstRowBytes, | 29 void* dst, size_t dstRowBytes, |
| 30 const Options& opts, | 30 const Options& opts, |
| 31 SkPMColor* inputColorPtr, | 31 SkPMColor* inputColorPtr, |
| 32 int* inputColorCount) { | 32 int* inputColorCount) { |
| 33 if (!this->rewindIfNeeded()) { | |
| 34 return kCouldNotRewind; | |
| 35 } | |
| 36 if (opts.fSubset) { | 33 if (opts.fSubset) { |
| 37 // Subsets are not supported. | 34 // Subsets are not supported. |
| 38 return kUnimplemented; | 35 return kUnimplemented; |
| 39 } | 36 } |
| 40 if (dstInfo.dimensions() != this->getInfo().dimensions()) { | 37 if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
| 41 SkCodecPrintf("Error: scaling not supported.\n"); | 38 SkCodecPrintf("Error: scaling not supported.\n"); |
| 42 return kInvalidScale; | 39 return kInvalidScale; |
| 43 } | 40 } |
| 44 | 41 |
| 45 if (!conversion_possible(dstInfo, this->getInfo())) { | 42 if (!conversion_possible(dstInfo, this->getInfo())) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 98 |
| 102 // Decode the row in destination format | 99 // Decode the row in destination format |
| 103 uint32_t row = this->getDstRow(y, height); | 100 uint32_t row = this->getDstRow(y, height); |
| 104 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); | 101 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
| 105 fMaskSwizzler->swizzle(dstRow, srcRow); | 102 fMaskSwizzler->swizzle(dstRow, srcRow); |
| 106 } | 103 } |
| 107 | 104 |
| 108 // Finished decoding the entire image | 105 // Finished decoding the entire image |
| 109 return kSuccess; | 106 return kSuccess; |
| 110 } | 107 } |
| OLD | NEW |