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

Side by Side Diff: include/core/SkChunkReader.h

Issue 1040453002: Add SkPngChunkReader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Peeker -> SkChunkReader, passed to constructor. Created 5 years, 8 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
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkChunkReader_DEFINED
9 #define SkChunkReader_DEFINED
10
11 #include "SkTypes.h"
12 #include "SkRefCnt.h"
13
14 /**
15 * ChunkReader
reed1 2015/03/27 20:13:47 ImageChunkReader, or PNGChunkReader? It just feel
scroggo 2015/04/01 14:53:48 Done.
16 * Base class for optional callbacks to retrieve meta/chunk data out of an
17 * encoded image as it is being decoded.
18 * Used by SkImageDecoder and SkCodec.
19 */
20 class SkChunkReader : public SkRefCnt {
scroggo 2015/03/27 19:19:59 How's the name? Or maybe it should be ChunkParser?
21 public:
22 SK_DECLARE_INST_COUNT(SkChunkReader)
23
24 /**
25 * This will be called by the decoder when it sees an unknown chunk.
26 *
27 * @param tag Name for this type of chunk.
28 * @param data Data to be interpreted by the subclass.
29 * @param length Number of bytes of data in the chunk.
30 * @return true to continue decoding, or false to indicate an error, which
31 * will cause the decoder to not return the image.
32 */
33 virtual bool readChunk(const char tag[], const void* data, size_t length) = 0;
34 };
35 #endif // SkChunkReader_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698