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

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

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Attempt to fix RLE overflow 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
« no previous file with comments | « src/codec/SkBmpRLECodec.cpp ('k') | src/codec/SkBmpStandardCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 int*) override; 47 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 SkSampler* getSampler() override { return fSwizzler; }
58
57 private: 59 private:
58 60
59 /* 61 /*
60 * Creates the color table 62 * Creates the color table
61 * Sets colorCount to the new color count if it is non-nullptr 63 * Sets colorCount to the new color count if it is non-nullptr
62 */ 64 */
63 bool createColorTable(SkAlphaType alphaType, int* colorCount); 65 bool createColorTable(SkAlphaType alphaType, int* colorCount);
64 66
65 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts); 67 bool initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts);
66 68
67 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes, 69 Result decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes,
68 const Options& opts) override; 70 const Options& opts) override;
69 71
70 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt es); 72 Result decodeIcoMask(const SkImageInfo& dstInfo, void* dst, size_t dstRowByt es);
71 73
72 SkAutoTUnref<SkColorTable> fColorTable; // owned 74 SkAutoTUnref<SkColorTable> fColorTable; // owned
73 const uint32_t fNumColors; 75 const uint32_t fNumColors;
74 const uint32_t fBytesPerColor; 76 const uint32_t fBytesPerColor;
75 const uint32_t fOffset; 77 const uint32_t fOffset;
76 SkAutoTDelete<SkSwizzler> fSwizzler; 78 SkAutoTDelete<SkSwizzler> fSwizzler;
77 const size_t fSrcRowBytes; 79 const size_t fSrcRowBytes;
78 SkAutoTDeleteArray<uint8_t> fSrcBuffer; 80 SkAutoTDeleteArray<uint8_t> fSrcBuffer;
79 const bool fInIco; 81 const bool fInIco;
80 82
81 typedef SkBmpCodec INHERITED; 83 typedef SkBmpCodec INHERITED;
82 }; 84 };
OLDNEW
« no previous file with comments | « src/codec/SkBmpRLECodec.cpp ('k') | src/codec/SkBmpStandardCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698