skia2/include/core/SkPngChunkReader.h
msarett 910f7ec7e7 Revert of Delete SkImageDecoder (patchset #9 id:150001 of https://codereview.chromium.org/1820503002/ )
Reason for revert:
Roll still failing

Original issue's description:
> 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

TBR=scroggo@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1830943002
2016-03-24 04:45:39 -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 SkImageDecoder and 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