Clarify SkCodec::getFrameInfo comment re animation

Change-Id: I7f20b850baf39fd01d7d5f817c52179920121e09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478716
Auto-Submit: Nigel Tao <nigeltao@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
This commit is contained in:
Nigel Tao 2021-12-02 12:59:18 +11:00 committed by SkCQ
parent 11d9f1515b
commit 8d95ffce92

View File

@ -684,9 +684,21 @@ public:
/**
* Return info about a single frame.
*
* Only supported by multi-frame images. Does not read through the stream,
* so it should be called after getFrameCount() to parse any frames that
* have not already been parsed.
* Does not read through the stream, so it should be called after
* getFrameCount() to parse any frames that have not already been parsed.
*
* Only supported by animated (multi-frame) codecs. Note that this is a
* property of the codec (the SkCodec subclass), not the image.
*
* To elaborate, some codecs support animation (e.g. GIF). Others do not
* (e.g. BMP). Animated codecs can still represent single frame images.
* Calling getFrameInfo(0, etc) will return true for a single frame GIF
* even if the overall image is not animated (in that the pixels on screen
* do not change over time). When incrementally decoding a GIF image, we
* might only know that there's a single frame *so far*.
*
* For non-animated SkCodec subclasses, it's sufficient but not necessary
* for this method to always return false.
*/
bool getFrameInfo(int index, FrameInfo* info) const {
if (index < 0) {
@ -703,7 +715,8 @@ public:
*
* As such, future decoding calls may require a rewind.
*
* For still (non-animated) image codecs, this will return an empty vector.
* This may return an empty vector for non-animated codecs. See the
* getFrameInfo(int, FrameInfo*) comment.
*/
std::vector<FrameInfo> getFrameInfo();