From 674a1848ae62277ea9a2d022b60aa1f17d306f17 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Thu, 6 Jul 2017 12:26:09 -0400 Subject: Add SkCodec::Result indicating error in the data Previously, SkGifCodec treated an error in the LZW data as incomplete, since we can still draw the partially decoded image. But a client doing incremental decodes needs to distinguish this from truly incomplete data. In the case of an error, the client should not attempt to provide more data and decode again. Add kErrorInInput, and return it when SkGifCodec sees a fatal error. Treat it the same as kIncompleteInput when it comes to filling and DM. Bug: skia:6825 Change-Id: Ic6ce3a62c0b065ed34dcd8006309e43272a3db9f Reviewed-on: https://skia-review.googlesource.com/21530 Commit-Queue: Leon Scroggins Reviewed-by: Mike Reed Reviewed-by: Chris Blume --- include/codec/SkCodec.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/codec') diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h index 6b3aa5e020..2043d230b1 100644 --- a/include/codec/SkCodec.h +++ b/include/codec/SkCodec.h @@ -194,6 +194,13 @@ public: * The input is incomplete. A partial image was generated. */ kIncompleteInput, + /** + * Like kIncompleteInput, except the input had an error. + * + * If returned from an incremental decode, decoding cannot continue, + * even with more data. + */ + kErrorInInput, /** * The generator cannot convert to match the request, ignoring * dimensions. -- cgit v1.2.3