| 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 "SkImageInfo.h" | 9 #include "SkImageInfo.h" |
| 10 #include "SkMaskSwizzler.h" | 10 #include "SkMaskSwizzler.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * Called only by SkBmpCodec::NewFromStream | 22 * Called only by SkBmpCodec::NewFromStream |
| 23 * There should be no other callers despite this being public | 23 * There should be no other callers despite this being public |
| 24 * | 24 * |
| 25 * @param srcInfo contains the source width and height | 25 * @param srcInfo contains the source width and height |
| 26 * @param stream the stream of encoded image data | 26 * @param stream the stream of encoded image data |
| 27 * @param bitsPerPixel the number of bits used to store each pixel | 27 * @param bitsPerPixel the number of bits used to store each pixel |
| 28 * @param masks color masks for certain bmp formats | 28 * @param masks color masks for certain bmp formats |
| 29 * @param rowOrder indicates whether rows are ordered top-down or bottom-up | 29 * @param rowOrder indicates whether rows are ordered top-down or bottom-up |
| 30 */ | 30 */ |
| 31 SkBmpMaskCodec(const SkImageInfo& srcInfo, SkStream* stream, | 31 SkBmpMaskCodec(const SkImageInfo& srcInfo, SkStream* stream, |
| 32 uint16_t bitsPerPixel, SkMasks* masks, RowOrder rowOrder); | 32 uint16_t bitsPerPixel, SkMasks* masks, RowOrder rowOrder); |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 | 35 |
| 36 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, | 36 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, |
| 37 size_t dstRowBytes, const Options&, SkPMColor*, | 37 size_t dstRowBytes, const Options&, SkPMColor*, |
| 38 int*) override; | 38 int*) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 | 41 |
| 42 bool initializeSwizzler(const SkImageInfo& dstInfo); | 42 bool initializeSwizzler(const SkImageInfo& dstInfo); |
| 43 | 43 |
| 44 SkCodec::Result onStart(const SkImageInfo& dstInfo, const SkCodec::Options&
options, |
| 45 SkPMColor inputColorPtr[], int* inputColorCount) override; |
| 46 |
| 44 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, | 47 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, |
| 45 const Options& opts); | 48 const Options& opts) override; |
| 46 | 49 |
| 47 SkAutoTDelete<SkMasks> fMasks; // owned | 50 SkAutoTDelete<SkMasks> fMasks; // owned |
| 48 SkAutoTDelete<SkMaskSwizzler> fMaskSwizzler; | 51 SkAutoTDelete<SkMaskSwizzler> fMaskSwizzler; |
| 49 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 52 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
| 50 | 53 |
| 51 typedef SkBmpCodec INHERITED; | 54 typedef SkBmpCodec INHERITED; |
| 52 }; | 55 }; |
| OLD | NEW |