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

Unified Diff: src/codec/SkCodec_libpng.h

Issue 930283002: Add SkCodec, including PNG implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Check in prebuilt file directly Created 5 years, 10 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
new file mode 100644
index 0000000000000000000000000000000000000000..a5327dda4155afc7085583148e661b3780e1cca0
--- /dev/null
+++ b/src/codec/SkCodec_libpng.h
@@ -0,0 +1,34 @@
+/*
+ * 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 "SkImageInfo.h"
+
+extern "C" {
+ // FIXME: I'd like to force all platforms to use the same decoder, but this
+ // means an extra dependency on Mac/Win.
+ #include "png.h"
+}
+
+class SkStream;
+
+class SkPngCodec : public SkCodec {
+public:
+ // Assumes IsPng was called and returned true.
+ static SkCodec* NewFromStream(SkStream*);
+ static bool IsPng(SkStream*);
+protected:
+ Result onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*, int*) SK_OVERRIDE;
+private:
+ png_structp fPng_ptr;
+ png_infop fInfo_ptr;
+
+ SkPngCodec(const SkImageInfo&, SkStream*, png_structp, png_infop);
+ ~SkPngCodec();
+
+ 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