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

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

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase on merged SkCodec and SkScanlineDecoder Created 5 years, 2 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 25 matching lines...) Expand all
36 */ 36 */
37 SkBmpRLECodec(const SkImageInfo& srcInfo, SkStream* stream, 37 SkBmpRLECodec(const SkImageInfo& srcInfo, SkStream* stream,
38 uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor, 38 uint16_t bitsPerPixel, uint32_t numColors, uint32_t bytesPerColor,
39 uint32_t offset, SkCodec::SkScanlineOrder rowOrder, 39 uint32_t offset, SkCodec::SkScanlineOrder rowOrder,
40 size_t RLEBytes); 40 size_t RLEBytes);
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*, int*) override;
47 47
48 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo, 48 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
49 const SkCodec::Options& options, SkPMColor inputColorPtr[], 49 const SkCodec::Options& options, SkPMColor inputColorPtr[],
50 int* inputColorCount) override; 50 int* inputColorCount) override;
51 51
52 private: 52 private:
53 53
54 /* 54 /*
55 * Creates the color table 55 * Creates the color table
56 * Sets colorCount to the new color count if it is non-nullptr 56 * Sets colorCount to the new color count if it is non-nullptr
(...skipping 17 matching lines...) Expand all
74 void setPixel(void* dst, size_t dstRowBytes, 74 void setPixel(void* dst, size_t dstRowBytes,
75 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, 75 const SkImageInfo& dstInfo, uint32_t x, uint32_t y,
76 uint8_t index); 76 uint8_t index);
77 /* 77 /*
78 * Set an RLE24 pixel from R, G, B values 78 * Set an RLE24 pixel from R, G, B values
79 */ 79 */
80 void setRGBPixel(void* dst, size_t dstRowBytes, 80 void setRGBPixel(void* dst, size_t dstRowBytes,
81 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, 81 const SkImageInfo& dstInfo, uint32_t x, uint32_t y,
82 uint8_t red, uint8_t green, uint8_t blue); 82 uint8_t red, uint8_t green, uint8_t blue);
83 83
84 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, 84 uint32_t decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowByte s,
85 const Options& opts) override; 85 const Options& opts) override;
86 86
87 SkAutoTUnref<SkColorTable> fColorTable; // owned 87 SkAutoTUnref<SkColorTable> fColorTable; // owned
88 const uint32_t fNumColors; 88 const uint32_t fNumColors;
89 const uint32_t fBytesPerColor; 89 const uint32_t fBytesPerColor;
90 const uint32_t fOffset; 90 const uint32_t fOffset;
91 SkAutoTDeleteArray<uint8_t> fStreamBuffer; 91 SkAutoTDeleteArray<uint8_t> fStreamBuffer;
92 size_t fRLEBytes; 92 size_t fRLEBytes;
93 uint32_t fCurrRLEByte; 93 uint32_t fCurrRLEByte;
94 int fSampleX; 94 int fSampleX;
95 95
96 typedef SkBmpCodec INHERITED; 96 typedef SkBmpCodec INHERITED;
97 }; 97 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698