| 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 "SkBmpStandardCodec.h" | 8 #include "SkBmpStandardCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 {} | 59 {} |
| 60 | 60 |
| 61 /* | 61 /* |
| 62 * Initiates the bitmap decode | 62 * Initiates the bitmap decode |
| 63 */ | 63 */ |
| 64 SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo, | 64 SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo, |
| 65 void* dst, size_t dstRowBytes, | 65 void* dst, size_t dstRowBytes, |
| 66 const Options& opts, | 66 const Options& opts, |
| 67 SkPMColor* inputColorPtr, | 67 SkPMColor* inputColorPtr, |
| 68 int* inputColorCount) { | 68 int* inputColorCount) { |
| 69 if (!this->handleRewind(fInIco)) { | 69 if (!this->rewindIfNeeded()) { |
| 70 return kCouldNotRewind; | 70 return kCouldNotRewind; |
| 71 } | 71 } |
| 72 if (opts.fSubset) { | 72 if (opts.fSubset) { |
| 73 // Subsets are not supported. | 73 // Subsets are not supported. |
| 74 return kUnimplemented; | 74 return kUnimplemented; |
| 75 } | 75 } |
| 76 if (dstInfo.dimensions() != this->getInfo().dimensions()) { | 76 if (dstInfo.dimensions() != this->getInfo().dimensions()) { |
| 77 SkCodecPrintf("Error: scaling not supported.\n"); | 77 SkCodecPrintf("Error: scaling not supported.\n"); |
| 78 return kInvalidScale; | 78 return kInvalidScale; |
| 79 } | 79 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 uint32_t alphaBit = | 352 uint32_t alphaBit = |
| 353 (fSrcBuffer.get()[quotient] >> shift) & 0x1; | 353 (fSrcBuffer.get()[quotient] >> shift) & 0x1; |
| 354 dstRow[x] &= alphaBit - 1; | 354 dstRow[x] &= alphaBit - 1; |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 | 358 |
| 359 // Finished decoding the entire image | 359 // Finished decoding the entire image |
| 360 return kSuccess; | 360 return kSuccess; |
| 361 } | 361 } |
| OLD | NEW |