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" |
11 #include "SkStream.h" | 11 #include "SkStream.h" |
12 | 12 |
13 /* | 13 /* |
14 * Creates an instance of the decoder | 14 * Creates an instance of the decoder |
15 * Called only by NewFromStream | 15 * Called only by NewFromStream |
16 */ | 16 */ |
17 SkBmpRLECodec::SkBmpRLECodec(int width, int height, const SkEncodedInfo& info, S
kStream* stream, | 17 SkBmpRLECodec::SkBmpRLECodec(const SkImageInfo& info, SkStream* stream, |
18 uint16_t bitsPerPixel, uint32_t numColors, | 18 uint16_t bitsPerPixel, uint32_t numColors, |
19 uint32_t bytesPerColor, uint32_t offset, | 19 uint32_t bytesPerColor, uint32_t offset, |
20 SkCodec::SkScanlineOrder rowOrder, | 20 SkCodec::SkScanlineOrder rowOrder, |
21 size_t RLEBytes) | 21 size_t RLEBytes) |
22 : INHERITED(width, height, info, stream, bitsPerPixel, rowOrder) | 22 : INHERITED(info, stream, bitsPerPixel, rowOrder) |
23 , fColorTable(nullptr) | 23 , fColorTable(nullptr) |
24 , fNumColors(numColors) | 24 , fNumColors(numColors) |
25 , fBytesPerColor(bytesPerColor) | 25 , fBytesPerColor(bytesPerColor) |
26 , fOffset(offset) | 26 , fOffset(offset) |
27 , fStreamBuffer(new uint8_t[RLEBytes]) | 27 , fStreamBuffer(new uint8_t[RLEBytes]) |
28 , fRLEBytes(RLEBytes) | 28 , fRLEBytes(RLEBytes) |
29 , fOrigRLEBytes(RLEBytes) | 29 , fOrigRLEBytes(RLEBytes) |
30 , fCurrRLEByte(0) | 30 , fCurrRLEByte(0) |
31 , fSampleX(1) | 31 , fSampleX(1) |
32 {} | 32 {} |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 fSampler.reset(new SkBmpRLESampler(this)); | 539 fSampler.reset(new SkBmpRLESampler(this)); |
540 } | 540 } |
541 | 541 |
542 return fSampler; | 542 return fSampler; |
543 } | 543 } |
544 | 544 |
545 int SkBmpRLECodec::setSampleX(int sampleX){ | 545 int SkBmpRLECodec::setSampleX(int sampleX){ |
546 fSampleX = sampleX; | 546 fSampleX = sampleX; |
547 return get_scaled_dimension(this->getInfo().width(), sampleX); | 547 return get_scaled_dimension(this->getInfo().width(), sampleX); |
548 } | 548 } |
OLD | NEW |