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

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

Issue 1040453002: Add SkPngChunkReader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update SkImageDecoder_empty Created 5 years, 1 month 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 | « include/core/SkImageDecoder.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SkPngChunkReader_DEFINED
9 #define SkPngChunkReader_DEFINED
10
11 #include "SkTypes.h"
12 #include "SkRefCnt.h"
13
14 /**
15 * SkPngChunkReader
16 *
17 * Base class for optional callbacks to retrieve meta/chunk data out of a PNG
18 * encoded image as it is being decoded.
19 * Used by SkImageDecoder and SkCodec.
20 */
21 class SkPngChunkReader : public SkRefCnt {
22 public:
23 /**
24 * This will be called by the decoder when it sees an unknown chunk.
25 *
26 * Use by SkCodec:
27 * Depending on the location of the unknown chunks, this callback may be
28 * called by
29 * - the factory (NewFromStream/NewFromData)
30 * - getPixels
31 * - startScanlineDecode
32 * - the first call to getScanlines/skipScanlines
33 * The callback may be called from a different thread (e.g. if the SkCodec
34 * is passed to another thread), and it may be called multiple times, if
35 * the SkCodec is used multiple times.
36 *
37 * @param tag Name for this type of chunk.
38 * @param data Data to be interpreted by the subclass.
39 * @param length Number of bytes of data in the chunk.
40 * @return true to continue decoding, or false to indicate an error, which
41 * will cause the decoder to not return the image.
42 */
43 virtual bool readChunk(const char tag[], const void* data, size_t length) = 0;
44 };
45 #endif // SkPngChunkReader_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkImageDecoder.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698