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

Unified Diff: src/codec/SkCodec_libpng.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, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/codec/SkCodec_libpng.h
diff --git a/src/codec/SkCodec_libpng.h b/src/codec/SkCodec_libpng.h
index 3afaa39bf4f4d84917bf9b3eb7fabaddda6991af..c16c1c18ea7a7543d66a9dae630cccbaf708e68c 100644
--- a/src/codec/SkCodec_libpng.h
+++ b/src/codec/SkCodec_libpng.h
@@ -7,6 +7,7 @@
#include "SkCodec.h"
#include "SkColorTable.h"
+#include "SkChunkReader.h"
#include "SkEncodedFormat.h"
#include "SkImageInfo.h"
#include "SkRefCnt.h"
@@ -22,7 +23,7 @@ class SkStream;
class SkPngCodec : public SkCodec {
public:
// Assumes IsPng was called and returned true.
- static SkCodec* NewFromStream(SkStream*);
+ static SkCodec* NewFromStream(SkStream*, SkChunkReader* = NULL);
static bool IsPng(SkStream*);
protected:
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*)
@@ -31,6 +32,7 @@ protected:
SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo) override;
bool onReallyHasAlpha() const override { return fReallyHasAlpha; }
private:
+ SkAutoTUnref<SkChunkReader> fChunkReader;
png_structp fPng_ptr;
png_infop fInfo_ptr;
@@ -42,7 +44,7 @@ private:
int fNumberPasses;
bool fReallyHasAlpha;
- SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop);
+ SkPngCodec(const SkImageInfo&, SkStream*, SkChunkReader*, png_structp, png_infop);
~SkPngCodec();
// Helper to set up swizzler and color table. Also calls png_read_update_info.

Powered by Google App Engine
This is Rietveld 408576698