Chromium Code Reviews| Index: include/codec/SkCodec.h |
| diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
| index a97a79c4bb72b78a8db383b51fa454b289025101..27b8a997e7ade596db4b024653742977b96cc645 100644 |
| --- a/include/codec/SkCodec.h |
| +++ b/include/codec/SkCodec.h |
| @@ -604,6 +604,8 @@ public: |
| size_t fDuration; |
| }; |
| + static constexpr int kRepetitionCountInfinite = -1; |
| + |
| /** |
| * Return info about the frames in the image. |
| * |
| @@ -612,10 +614,15 @@ public: |
| * |
| * As such, future decoding calls may require a rewind. |
| * |
| - * For single-frame images, this will return an empty vector. |
| + * For single-frame images, this will return false and leave the out |
| + * parameters unmodified. |
| + * |
| + * @param outFrameInfo vector of info about each frame. |
| + * @param outRepetitionCount If non-NULL, this will be set to the number of |
| + * times an animated image should repeat. |
|
reed1
2016/10/31 14:17:01
Assuming this can take nullptr for outFrameInfo, t
scroggo
2016/10/31 19:12:27
I've updated the header, and updated the test to c
|
| */ |
| - std::vector<FrameInfo> getFrameInfo() { |
| - return this->onGetFrameInfo(); |
| + bool getFrameInfo(std::vector<FrameInfo>* outFrameInfo, int* outRepetitionCount) { |
| + return this->onGetFrameInfo(outFrameInfo, outRepetitionCount); |
| } |
| protected: |
| @@ -761,9 +768,9 @@ protected: |
| bool initializeColorXform(const SkImageInfo& dstInfo); |
| SkColorSpaceXform* colorXform() const { return fColorXform.get(); } |
| - virtual std::vector<FrameInfo> onGetFrameInfo() { |
| - // empty vector - this is not animated. |
| - return {}; |
| + virtual bool onGetFrameInfo(std::vector<FrameInfo>*, int*) { |
| + // default is not animated. |
| + return false; |
| } |
| /** |