Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "SkBmpCodec.h" | |
| 9 #include "SkImageInfo.h" | |
| 10 #include "SkMaskSwizzler.h" | |
| 11 #include "SkTypes.h" | |
| 12 | |
| 13 /* | |
| 14 * This class implements the decoding for bmp images using bit masks | |
| 15 */ | |
| 16 class SkBmpMaskCodec : public SkBmpCodec { | |
| 17 public: | |
| 18 | |
| 19 /* | |
| 20 * Creates an instance of the decoder | |
| 21 * Called only by SkBmpCodec::NewFromStream | |
| 22 * | |
| 23 * @param srcInfo contains the source width and height | |
| 24 * @param stream the stream of image data | |
| 25 * @param bitsPerPixel the number of bits used to store each pixel | |
| 26 * @param masks color masks for certain bmp formats | |
| 27 * @param rowOrder indicates whether rows are ordered top-down or bottom-up | |
| 28 */ | |
| 29 SkBmpMaskCodec(const SkImageInfo& srcInfo, SkStream* stream, | |
| 30 uint16_t bitsPerPixel, SkMasks* masks, RowOrder rowOrder); | |
| 31 | |
| 32 protected: | |
| 33 | |
| 34 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, | |
| 35 size_t dstRowBytes, const Options&, SkPMColor*, | |
| 36 int*) override; | |
| 37 | |
| 38 private: | |
| 39 | |
| 40 bool initializeSwizzler(const SkImageInfo& dstInfo); | |
|
msarett
2015/08/03 22:52:36
Creation of the swizzler has been factored out of
| |
| 41 | |
| 42 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, | |
|
msarett
2015/08/03 22:52:36
This used to be decodeMask() in SkBmpCodec.
| |
| 43 const Options& opts); | |
| 44 | |
| 45 SkAutoTDelete<SkMasks> fMasks; // owned | |
| 46 SkAutoTDelete<SkMaskSwizzler> fMaskSwizzler; | |
| 47 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | |
| 48 bool fIsTransparent; | |
| 49 | |
| 50 typedef SkBmpCodec INHERITED; | |
| 51 }; | |
| OLD | NEW |