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

Side by Side Diff: src/codec/SkCodec_wbmp.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/SkCodec_libpng.cpp ('k') | src/codec/SkCodec_wbmp.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 #ifndef SkCodec_wbmp_DEFINED 8 #ifndef SkCodec_wbmp_DEFINED
9 #define SkCodec_wbmp_DEFINED 9 #define SkCodec_wbmp_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 SkEncodedFormat onGetEncodedFormat() const override; 26 SkEncodedFormat onGetEncodedFormat() const override;
27 Result onGetPixels(const SkImageInfo&, void*, size_t, 27 Result onGetPixels(const SkImageInfo&, void*, size_t,
28 const Options&, SkPMColor[], int*) override; 28 const Options&, SkPMColor[], int*) override;
29 bool onRewind() override; 29 bool onRewind() override;
30 private: 30 private:
31 /* 31 /*
32 * Returns a swizzler on success, nullptr on failure 32 * Returns a swizzler on success, nullptr on failure
33 */ 33 */
34 SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* cta ble, 34 SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* cta ble,
35 const Options& opts); 35 const Options& opts);
36 SkSampler* getSampler() override { return fSwizzler; }
36 37
37 /* 38 /*
38 * Read a src row from the encoded stream 39 * Read a src row from the encoded stream
39 */ 40 */
40 Result readRow(uint8_t* row); 41 Result readRow(uint8_t* row);
41 42
42 SkWbmpCodec(const SkImageInfo&, SkStream*); 43 SkWbmpCodec(const SkImageInfo&, SkStream*);
43 44
44 const size_t fSrcRowBytes; 45 const size_t fSrcRowBytes;
45 46
46 // Used for scanline decodes: 47 // Used for scanline decodes:
47 SkAutoTUnref<SkColorTable> fColorTable; 48 SkAutoTUnref<SkColorTable> fColorTable;
48 SkAutoTDelete<SkSwizzler> fSwizzler; 49 SkAutoTDelete<SkSwizzler> fSwizzler;
49 SkAutoTMalloc<uint8_t> fSrcBuffer; 50 SkAutoTMalloc<uint8_t> fSrcBuffer;
50 51
51 // FIXME: Override onSkipScanlines to avoid swizzling. 52 // FIXME: Override onSkipScanlines to avoid swizzling.
52 Result onGetScanlines(void* dst, int count, size_t dstRowBytes) override; 53 Result onGetScanlines(void* dst, int count, size_t dstRowBytes) override;
53 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti ons, 54 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opti ons,
54 SkPMColor inputColorTable[], int* inputColorCount) override; 55 SkPMColor inputColorTable[], int* inputColorCount) override;
55 56
56 typedef SkCodec INHERITED; 57 typedef SkCodec INHERITED;
57 }; 58 };
58 59
59 #endif // SkCodec_wbmp_DEFINED 60 #endif // SkCodec_wbmp_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkCodec_wbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698