skia2/include/core/SkPngChunkReader.h
msarett e8597a4dd0 Delete SkImageDecoder
This image decoding implementation has been replaced
by SkCodec in Android.

Additionally, we have replaced uses of SkImageDecoder
in Skia and Google3 with uses of SkCodec.

Now we can delete SkImageDecoder :).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1820503002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Committed: https://skia.googlesource.com/skia/+/f799706656f2581c5bf5510d94df3fa17cce1607

Committed: https://skia.googlesource.com/skia/+/5b6e73e0c8282c4d85accbfbcecc6dee84f8a1eb

Committed: https://skia.googlesource.com/skia/+/f037fdebda2a2626e6512d7532063f2cd41a264d

Review URL: https://codereview.chromium.org/1820503002
2016-03-24 10:41:47 -07:00

46 lines
1.5 KiB
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkPngChunkReader_DEFINED
#define SkPngChunkReader_DEFINED
#include "SkTypes.h"
#include "SkRefCnt.h"
/**
* SkPngChunkReader
*
* Base class for optional callbacks to retrieve meta/chunk data out of a PNG
* encoded image as it is being decoded.
* Used by SkCodec.
*/
class SkPngChunkReader : public SkRefCnt {
public:
/**
* This will be called by the decoder when it sees an unknown chunk.
*
* Use by SkCodec:
* Depending on the location of the unknown chunks, this callback may be
* called by
* - the factory (NewFromStream/NewFromData)
* - getPixels
* - startScanlineDecode
* - the first call to getScanlines/skipScanlines
* The callback may be called from a different thread (e.g. if the SkCodec
* is passed to another thread), and it may be called multiple times, if
* the SkCodec is used multiple times.
*
* @param tag Name for this type of chunk.
* @param data Data to be interpreted by the subclass.
* @param length Number of bytes of data in the chunk.
* @return true to continue decoding, or false to indicate an error, which
* will cause the decoder to not return the image.
*/
virtual bool readChunk(const char tag[], const void* data, size_t length) = 0;
};
#endif // SkPngChunkReader_DEFINED