| 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 "SkBmpRLECodec.h" | 8 #include "SkBmpRLECodec.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 SkBmpRLECodec::onGetPixels(const SkImageInfo& dstInfo, | 64 SkCodec::Result SkBmpRLECodec::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(false)) { | 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // Set the indicated number of pixels | 421 // Set the indicated number of pixels |
| 422 for (int which = 0; x < endX; x++) { | 422 for (int which = 0; x < endX; x++) { |
| 423 setPixel(dst, dstRowBytes, dstInfo, x, y, | 423 setPixel(dst, dstRowBytes, dstInfo, x, y, |
| 424 indices[which]); | 424 indices[which]); |
| 425 which = !which; | 425 which = !which; |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 } | 430 } |
| OLD | NEW |