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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 */ | 37 */ |
38 SkBmpStandardCodec(const SkImageInfo& srcInfo, SkStream* stream, | 38 SkBmpStandardCodec(const SkImageInfo& srcInfo, SkStream* stream, |
39 uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor, | 39 uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor, |
40 uint32_t offset, SkCodec::SkScanlineOrder rowOrder, | 40 uint32_t offset, SkCodec::SkScanlineOrder rowOrder, |
41 bool isIco); | 41 bool isIco); |
42 | 42 |
43 protected: | 43 protected: |
44 | 44 |
45 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, | 45 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, |
46 size_t dstRowBytes, const Options&, SkPMColor*, | 46 size_t dstRowBytes, const Options&, SkPMColor*, |
47 int*) override; | 47 int*, int*) override; |
48 | 48 |
49 bool onInIco() const override { | 49 bool onInIco() const override { |
50 return fInIco; | 50 return fInIco; |
51 } | 51 } |
52 | 52 |
53 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo, | 53 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo, |
54 const SkCodec::Options& options, SkPMColor inputColorPtr[], | 54 const SkCodec::Options& options, SkPMColor inputColorPtr[], |
55 int* inputColorCount) override; | 55 int* inputColorCount) override; |
56 | 56 |
| 57 uint32_t onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const
override; |
| 58 |
57 private: | 59 private: |
58 | 60 |
59 /* | 61 /* |
60 * Creates the color table | 62 * Creates the color table |
61 * Sets colorCount to the new color count if it is non-nullptr | 63 * Sets colorCount to the new color count if it is non-nullptr |
62 */ | 64 */ |
63 bool createColorTable(SkAlphaType alphaType, int* colorCount); | 65 bool createColorTable(SkAlphaType alphaType, int* colorCount); |
64 | 66 |
65 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); | 67 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); |
66 | 68 |
67 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, | 69 uint32_t decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowByte
s, |
68 const Options& opts) override; | 70 const Options& opts) override; |
69 | 71 |
70 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt
es); | 72 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt
es); |
71 | 73 |
72 SkAutoTUnref<SkColorTable> fColorTable; // owned | 74 SkAutoTUnref<SkColorTable> fColorTable; // owned |
73 const uint32_t fNumColors; | 75 const uint32_t fNumColors; |
74 const uint32_t fBytesPerColor; | 76 const uint32_t fBytesPerColor; |
75 const uint32_t fOffset; | 77 const uint32_t fOffset; |
76 SkAutoTDelete<SkSwizzler> fSwizzler; | 78 SkAutoTDelete<SkSwizzler> fSwizzler; |
77 const size_t fSrcRowBytes; | 79 const size_t fSrcRowBytes; |
78 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 80 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
79 const bool fInIco; | 81 const bool fInIco; |
80 | 82 |
81 typedef SkBmpCodec INHERITED; | 83 typedef SkBmpCodec INHERITED; |
82 }; | 84 }; |
OLD | NEW |