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

Unified Diff: src/codec/SkCodec_libpng.h

Issue 1613043003: Rename SkCodec_libpng to SkPngCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libpng.h
diff --git a/src/codec/SkCodec_libpng.h b/src/codec/SkCodec_libpng.h
deleted file mode 100644
index 9a13a1267018e749ebe9be51f95cdae233eeb016..0000000000000000000000000000000000000000
--- a/src/codec/SkCodec_libpng.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkCodec.h"
-#include "SkColorTable.h"
-#include "SkPngChunkReader.h"
-#include "SkEncodedFormat.h"
-#include "SkImageInfo.h"
-#include "SkRefCnt.h"
-#include "SkSwizzler.h"
-
-#include "png.h"
-
-class SkStream;
-
-class SkPngCodec : public SkCodec {
-public:
- static bool IsPng(const char*, size_t);
-
- // Assume IsPng was called and returned true.
- static SkCodec* NewFromStream(SkStream*, SkPngChunkReader* = NULL);
-
- virtual ~SkPngCodec();
-
-protected:
- Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*, int*)
- override;
- SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedFormat; }
- bool onRewind() override;
- uint32_t onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const override;
-
- // Helper to set up swizzler and color table. Also calls png_read_update_info.
- Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
- SkPMColor*, int* ctableCount);
- SkSampler* getSampler(bool createIfNecessary) override {
- SkASSERT(fSwizzler);
- return fSwizzler;
- }
-
- SkPngCodec(const SkImageInfo&, SkStream*, SkPngChunkReader*, png_structp, png_infop, int, int);
-
- png_structp png_ptr() { return fPng_ptr; }
- SkSwizzler* swizzler() { return fSwizzler; }
- SkSwizzler::SrcConfig srcConfig() const { return fSrcConfig; }
- int numberPasses() const { return fNumberPasses; }
-
-private:
- SkAutoTUnref<SkPngChunkReader> fPngChunkReader;
- png_structp fPng_ptr;
- png_infop fInfo_ptr;
-
- // These are stored here so they can be used both by normal decoding and scanline decoding.
- SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
- SkAutoTDelete<SkSwizzler> fSwizzler;
-
- SkSwizzler::SrcConfig fSrcConfig;
- const int fNumberPasses;
- int fBitDepth;
-
- bool decodePalette(bool premultiply, int* ctableCount);
- void destroyReadStruct();
-
- typedef SkCodec INHERITED;
-};
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkCodec_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698