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" |
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 SkBmpStandardCodec::SkBmpStandardCodec(const SkImageInfo& info, SkStream* stream
, | 17 SkBmpStandardCodec::SkBmpStandardCodec(const SkEncodedInfo& info, SkStream* stre
am, |
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 bool isOpaque, bool inIco) | 21 bool isOpaque, bool inIco) |
22 : INHERITED(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 , fSwizzler(nullptr) | 27 , fSwizzler(nullptr) |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 319 } |
320 } | 320 } |
321 | 321 |
322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { | 322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { |
323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
324 if (colorPtr) { | 324 if (colorPtr) { |
325 return get_color_table_fill_value(colorType, colorPtr, 0); | 325 return get_color_table_fill_value(colorType, colorPtr, 0); |
326 } | 326 } |
327 return INHERITED::onGetFillValue(colorType); | 327 return INHERITED::onGetFillValue(colorType); |
328 } | 328 } |
OLD | NEW |