| 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 27 matching lines...) Expand all Loading... |
| 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, SkBmpCodec::RowOrder rowOrder, bool isIco); | 40 uint32_t offset, SkBmpCodec::RowOrder rowOrder, bool isIco); |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 | 43 |
| 44 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, | 44 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, |
| 45 size_t dstRowBytes, const Options&, SkPMColor*, | 45 size_t dstRowBytes, const Options&, SkPMColor*, |
| 46 int*) override; | 46 int*) override; |
| 47 | 47 |
| 48 bool onInIco() const override { |
| 49 return fInIco; |
| 50 } |
| 48 private: | 51 private: |
| 49 | 52 |
| 50 /* | 53 /* |
| 51 * Creates the color table | 54 * Creates the color table |
| 52 * Sets colorCount to the new color count if it is non-NULL | 55 * Sets colorCount to the new color count if it is non-NULL |
| 53 */ | 56 */ |
| 54 bool createColorTable(SkAlphaType alphaType, int* colorCount); | 57 bool createColorTable(SkAlphaType alphaType, int* colorCount); |
| 55 | 58 |
| 56 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); | 59 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); |
| 57 | 60 |
| 58 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, con
st Options& opts); | 61 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, con
st Options& opts); |
| 59 | 62 |
| 60 SkAutoTUnref<SkColorTable> fColorTable; // owned | 63 SkAutoTUnref<SkColorTable> fColorTable; // owned |
| 61 const uint32_t fNumColors; | 64 const uint32_t fNumColors; |
| 62 const uint32_t fBytesPerColor; | 65 const uint32_t fBytesPerColor; |
| 63 const uint32_t fOffset; | 66 const uint32_t fOffset; |
| 64 SkAutoTDelete<SkSwizzler> fSwizzler; | 67 SkAutoTDelete<SkSwizzler> fSwizzler; |
| 65 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 68 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
| 66 const bool fInIco; | 69 const bool fInIco; |
| 67 | 70 |
| 68 typedef SkBmpCodec INHERITED; | 71 typedef SkBmpCodec INHERITED; |
| 69 }; | 72 }; |
| OLD | NEW |