| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 numPixels--; | 444 numPixels--; |
| 445 break; | 445 break; |
| 446 case 24: { | 446 case 24: { |
| 447 SkASSERT(fCurrRLEByte + 2 < fRLEBytes); | 447 SkASSERT(fCurrRLEByte + 2 < fRLEBytes); |
| 448 uint8_t blue = fStreamBuffer.get()[fCurrRLEByte+
+]; | 448 uint8_t blue = fStreamBuffer.get()[fCurrRLEByte+
+]; |
| 449 uint8_t green = fStreamBuffer.get()[fCurrRLEByte
++]; | 449 uint8_t green = fStreamBuffer.get()[fCurrRLEByte
++]; |
| 450 uint8_t red = fStreamBuffer.get()[fCurrRLEByte++
]; | 450 uint8_t red = fStreamBuffer.get()[fCurrRLEByte++
]; |
| 451 setRGBPixel(dst, dstRowBytes, dstInfo, | 451 setRGBPixel(dst, dstRowBytes, dstInfo, |
| 452 x++, y, red, green, blue); | 452 x++, y, red, green, blue); |
| 453 numPixels--; | 453 numPixels--; |
| 454 break; |
| 454 } | 455 } |
| 455 default: | 456 default: |
| 456 SkASSERT(false); | 457 SkASSERT(false); |
| 457 return y; | 458 return y; |
| 458 } | 459 } |
| 459 } | 460 } |
| 460 // Skip a byte if necessary to maintain alignment | 461 // Skip a byte if necessary to maintain alignment |
| 461 if (!SkIsAlign2(rowBytes)) { | 462 if (!SkIsAlign2(rowBytes)) { |
| 462 fCurrRLEByte++; | 463 fCurrRLEByte++; |
| 463 } | 464 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 fSampler.reset(new SkBmpRLESampler(this)); | 548 fSampler.reset(new SkBmpRLESampler(this)); |
| 548 } | 549 } |
| 549 | 550 |
| 550 return fSampler; | 551 return fSampler; |
| 551 } | 552 } |
| 552 | 553 |
| 553 int SkBmpRLECodec::setSampleX(int sampleX){ | 554 int SkBmpRLECodec::setSampleX(int sampleX){ |
| 554 fSampleX = sampleX; | 555 fSampleX = sampleX; |
| 555 return get_scaled_dimension(this->getInfo().width(), sampleX); | 556 return get_scaled_dimension(this->getInfo().width(), sampleX); |
| 556 } | 557 } |
| OLD | NEW |