aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/codec
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-09-30 09:15:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 09:15:14 -0700
commit3a7701c0101386ba05acdde6f911be0c2696f317 (patch)
treecf32920b67df2f2553cb22d1fe420c9bab45d4c5 /include/codec
parent46c574725676b26ada63ac15e42cda309dcd5090 (diff)
Call rewindIfNeeded in SkCodec
Rather than calling it in each subclass, call it once in the base class. Call it first, since other steps may modify internal structures which would be replaced by a call to onRewind. BUG=skia:4284 Review URL: https://codereview.chromium.org/1381483002
Diffstat (limited to 'include/codec')
-rw-r--r--include/codec/SkCodec.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index 01fd4fa62a..c0cce853a3 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -402,9 +402,8 @@ protected:
* @returns true if the codec is at the right position and can be used.
* false if there was a failure to rewind.
*
- * Subclasses MUST call this function before reading the stream (e.g. in
- * onGetPixels). If it returns false, onGetPixels should return
- * kCouldNotRewind.
+ * This is called by getPixels() and start(). Subclasses may call if they
+ * need to rewind at another time.
*/
bool SK_WARN_UNUSED_RESULT rewindIfNeeded();