Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: src/codec/SkBmpStandardCodec.h

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 * @param bitsPerPixel the number of bits used to store each pixel 29 * @param bitsPerPixel the number of bits used to store each pixel
30 * @param format the format of the bmp file 30 * @param format the format of the bmp file
31 * @param numColors the number of colors in the color table 31 * @param numColors the number of colors in the color table
32 * @param bytesPerColor the number of bytes in the stream used to represent 32 * @param bytesPerColor the number of bytes in the stream used to represent
33 each color in the color table 33 each color in the color table
34 * @param offset the offset of the image pixel data from the end of the 34 * @param offset the offset of the image pixel data from the end of the
35 * headers 35 * headers
36 * @param rowOrder indicates whether rows are ordered top-down or bottom-up 36 * @param rowOrder indicates whether rows are ordered top-down or bottom-up
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, 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 { 48 bool onInIco() const override {
49 return fInIco; 49 return fInIco;
50 } 50 }
51 private: 51 private:
52 52
53 /* 53 /*
54 * Creates the color table 54 * Creates the color table
55 * 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
56 */ 56 */
57 bool createColorTable(SkAlphaType alphaType, int* colorCount); 57 bool createColorTable(SkAlphaType alphaType, int* colorCount);
58 58
59 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); 59 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts);
60 60
61 Result decode(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, con st Options& opts); 61 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
62 const SkCodec::Options& options, SkPMColor inputColorPtr[],
63 int* inputColorCount) override;
64
65 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
66 const Options& opts) override;
67
68 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt es);
62 69
63 SkAutoTUnref<SkColorTable> fColorTable; // owned 70 SkAutoTUnref<SkColorTable> fColorTable; // owned
64 const uint32_t fNumColors; 71 const uint32_t fNumColors;
65 const uint32_t fBytesPerColor; 72 const uint32_t fBytesPerColor;
66 const uint32_t fOffset; 73 const uint32_t fOffset;
67 SkAutoTDelete<SkSwizzler> fSwizzler; 74 SkAutoTDelete<SkSwizzler> fSwizzler;
75 const size_t fSrcRowBytes;
68 SkAutoTDeleteArray<uint8_t> fSrcBuffer; 76 SkAutoTDeleteArray<uint8_t> fSrcBuffer;
69 const bool fInIco; 77 const bool fInIco;
70 78
71 typedef SkBmpCodec INHERITED; 79 typedef SkBmpCodec INHERITED;
72 }; 80 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698