Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: include/codec/SkCodec.h

Issue 2447863002: Report repetition count in SkCodec (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkCodecAnimation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index a97a79c4bb72b78a8db383b51fa454b289025101..4752b7b5e99e4f06d7d4b35e3ec5bc87db85a621 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,14 @@ 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 an empty vector and leave
+ * outRepetitionCount unmodified.
+ *
+ * @param outRepetitionCount If non-NULL, this will be set to the number of
+ * times an animated image should repeat.
*/
- std::vector<FrameInfo> getFrameInfo() {
- return this->onGetFrameInfo();
+ std::vector<FrameInfo> getFrameInfo(int* outRepetitionCount = nullptr) {
cblume 2016/10/26 17:45:59 I like where this is going. I am pretty sure I wo
scroggo_chromium 2016/10/26 18:42:18 (I assume "more buffers" means "more data"?) Yes,
scroggo_chromium 2016/10/27 20:54:16 patch set 2 returns a bool, and uses multiple out
cblume 2016/10/28 01:09:41 patch set 2's solution would allow us to reuse all
cblume 2016/10/28 01:09:41 Actually, I may have said this wrong. I definitel
scroggo_chromium 2016/10/28 11:49:40 I still think you always want the FrameInfo when y
+ return this->onGetFrameInfo(outRepetitionCount);
}
protected:
@@ -761,7 +767,7 @@ protected:
bool initializeColorXform(const SkImageInfo& dstInfo);
SkColorSpaceXform* colorXform() const { return fColorXform.get(); }
- virtual std::vector<FrameInfo> onGetFrameInfo() {
+ virtual std::vector<FrameInfo> onGetFrameInfo(int*) {
// empty vector - this is not animated.
return {};
}
« no previous file with comments | « no previous file | src/codec/SkCodecAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698