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

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

Issue 1472123002: Make SkCodec support peek() and read() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 years 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_libico.cpp ('k') | src/codec/SkCodec_libpng.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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkColorTable.h" 9 #include "SkColorTable.h"
10 #include "SkPngChunkReader.h" 10 #include "SkPngChunkReader.h"
11 #include "SkEncodedFormat.h" 11 #include "SkEncodedFormat.h"
12 #include "SkImageInfo.h" 12 #include "SkImageInfo.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkSwizzler.h" 14 #include "SkSwizzler.h"
15 15
16 #include "png.h" 16 #include "png.h"
17 17
18 class SkStream; 18 class SkStream;
19 19
20 class SkPngCodec : public SkCodec { 20 class SkPngCodec : public SkCodec {
21 public: 21 public:
22 static bool IsPng(SkStream*); 22 static bool IsPng(const char*, size_t);
23 23
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; }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkSwizzler::SrcConfig fSrcConfig; 74 SkSwizzler::SrcConfig fSrcConfig;
75 const int fNumberPasses; 75 const int fNumberPasses;
76 int fBitDepth; 76 int fBitDepth;
77 AlphaState fAlphaState; 77 AlphaState fAlphaState;
78 78
79 bool decodePalette(bool premultiply, int* ctableCount); 79 bool decodePalette(bool premultiply, int* ctableCount);
80 void destroyReadStruct(); 80 void destroyReadStruct();
81 81
82 typedef SkCodec INHERITED; 82 typedef SkCodec INHERITED;
83 }; 83 };
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libico.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698