***Disables swizzles to 565.
We may want to enable swizzles to 565
for images that are encoded in a format
similar to 565, however, we do not want
to take images that decode naturally to
kN32 and then convert them to 565.
***Enable swizzles to kIndex_8. For images
encoded in a color table format, we suggest
that they be decoded to kIndex_8. When we
decode, we only allow conversion to kIndex_8
if it matches the suggested color type (except
wbmp which seems good as is).
***Modify dm to test images that decode to
kIndex_8.
BUG=skia:3257
BUG=skia:3440
Review URL: https://codereview.chromium.org/1055743003
diff --git a/src/codec/SkCodec_libgif.h b/src/codec/SkCodec_libgif.h
index de59c6c..d805acc 100644
--- a/src/codec/SkCodec_libgif.h
+++ b/src/codec/SkCodec_libgif.h
@@ -34,6 +34,27 @@
protected:
/*
+ * Read enough of the stream to initialize the SkGifCodec.
+ * Returns a bool representing success or failure.
+ *
+ * @param codecOut
+ * If it returned true, and codecOut was not NULL,
+ * codecOut will be set to a new SkGifCodec.
+ *
+ * @param gifOut
+ * If it returned true, and codecOut was NULL,
+ * gifOut must be non-NULL and gifOut will be set to a new
+ * GifFileType pointer.
+ *
+ * @param stream
+ * Deleted on failure.
+ * codecOut will take ownership of it in the case where we created a codec.
+ * Ownership is unchanged when we returned a gifOut.
+ *
+ */
+ static bool ReadHeader(SkStream* stream, SkCodec** codecOut, GifFileType** gifOut);
+
+ /*
* Initiates the gif decode
*/
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&,
@@ -49,7 +70,7 @@
* This function cleans up the gif object after the decode completes
* It is used in a SkAutoTCallIProc template
*/
- static int32_t CloseGif(GifFileType* gif);
+ static void CloseGif(GifFileType* gif);
/*
* Frees any extension data used in the decode
@@ -68,7 +89,7 @@
*/
SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif);
- SkAutoTCallIProc<GifFileType, CloseGif> fGif; // owned
+ SkAutoTCallVProc<GifFileType, CloseGif> fGif; // owned
typedef SkCodec INHERITED;
};