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

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

Issue 1641273003: Support decoding opaque to *premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update SkMaskSwizzler to support opaque to premul Created 4 years, 10 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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkColorTable.h" 9 #include "SkColorTable.h"
10 #include "SkPngChunkReader.h" 10 #include "SkPngChunkReader.h"
(...skipping 13 matching lines...) Expand all
24 // Assume IsPng was called and returned true. 24 // Assume IsPng was called and returned true.
25 static SkCodec* NewFromStream(SkStream*, SkPngChunkReader* = NULL); 25 static SkCodec* NewFromStream(SkStream*, SkPngChunkReader* = NULL);
26 26
27 virtual ~SkPngCodec(); 27 virtual ~SkPngCodec();
28 28
29 protected: 29 protected:
30 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo lor*, int*, int*) 30 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo lor*, int*, int*)
31 override; 31 override;
32 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF ormat; } 32 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF ormat; }
33 bool onRewind() override; 33 bool onRewind() override;
34 uint32_t onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const override; 34 uint32_t onGetFillValue(SkColorType) const override;
35 35
36 // Helper to set up swizzler and color table. Also calls png_read_update_inf o. 36 // Helper to set up swizzler and color table. Also calls png_read_update_inf o.
37 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, 37 Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
38 SkPMColor*, int* ctableCount); 38 SkPMColor*, int* ctableCount);
39 SkSampler* getSampler(bool createIfNecessary) override { 39 SkSampler* getSampler(bool createIfNecessary) override {
40 SkASSERT(fSwizzler); 40 SkASSERT(fSwizzler);
41 return fSwizzler; 41 return fSwizzler;
42 } 42 }
43 43
44 SkPngCodec(const SkImageInfo&, SkStream*, SkPngChunkReader*, png_structp, pn g_infop, int, int); 44 SkPngCodec(const SkImageInfo&, SkStream*, SkPngChunkReader*, png_structp, pn g_infop, int, int);
(...skipping 14 matching lines...) Expand all
59 59
60 SkSwizzler::SrcConfig fSrcConfig; 60 SkSwizzler::SrcConfig fSrcConfig;
61 const int fNumberPasses; 61 const int fNumberPasses;
62 int fBitDepth; 62 int fBitDepth;
63 63
64 bool decodePalette(bool premultiply, int* ctableCount); 64 bool decodePalette(bool premultiply, int* ctableCount);
65 void destroyReadStruct(); 65 void destroyReadStruct();
66 66
67 typedef SkCodec INHERITED; 67 typedef SkCodec INHERITED;
68 }; 68 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698