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

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

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Forgot to add SkSampler.cpp 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 26 matching lines...) Expand all
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, SkCodec::SkScanlineOrder rowOrder, 40 uint32_t offset, SkCodec::SkScanlineOrder rowOrder,
41 bool isIco); 41 bool isIco);
42 42
43 protected: 43 protected:
44 44
45 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, 45 Result onGetPixels(const SkImageInfo& dstInfo, void* dst,
46 size_t dstRowBytes, const Options&, SkPMColor*, 46 size_t dstRowBytes, const Options&, SkPMColor*,
47 int*) override; 47 int*, int*) override;
48 48
49 bool onInIco() const override { 49 bool onInIco() const override {
50 return fInIco; 50 return fInIco;
51 } 51 }
52 52
53 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo, 53 SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
54 const SkCodec::Options& options, SkPMColor inputColorPtr[], 54 const SkCodec::Options& options, SkPMColor inputColorPtr[],
55 int* inputColorCount) override; 55 int* inputColorCount) override;
56 56
57
58 uint32_t onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const override;
59
57 SkSampler* getSampler() override { return fSwizzler; } 60 SkSampler* getSampler() override { return fSwizzler; }
58 61
59 private: 62 private:
60 63
61 /* 64 /*
62 * Creates the color table 65 * Creates the color table
63 * Sets colorCount to the new color count if it is non-nullptr 66 * Sets colorCount to the new color count if it is non-nullptr
64 */ 67 */
65 bool createColorTable(SkAlphaType alphaType, int* colorCount); 68 bool createColorTable(SkAlphaType alphaType, int* colorCount);
66 69
67 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); 70 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts);
68 71
69 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, 72 int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
70 const Options& opts) override; 73 const Options& opts) override;
71 74
72 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt es); 75 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt es);
73 76
74 SkAutoTUnref<SkColorTable> fColorTable; // owned 77 SkAutoTUnref<SkColorTable> fColorTable; // owned
75 const uint32_t fNumColors; 78 const uint32_t fNumColors;
76 const uint32_t fBytesPerColor; 79 const uint32_t fBytesPerColor;
77 const uint32_t fOffset; 80 const uint32_t fOffset;
78 SkAutoTDelete<SkSwizzler> fSwizzler; 81 SkAutoTDelete<SkSwizzler> fSwizzler;
79 const size_t fSrcRowBytes; 82 const size_t fSrcRowBytes;
80 SkAutoTDeleteArray<uint8_t> fSrcBuffer; 83 SkAutoTDeleteArray<uint8_t> fSrcBuffer;
81 const bool fInIco; 84 const bool fInIco;
82 85
83 typedef SkBmpCodec INHERITED; 86 typedef SkBmpCodec INHERITED;
84 }; 87 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698