aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/android
diff options
context:
space:
mode:
Diffstat (limited to 'include/android')
-rw-r--r--include/android/SkAnimatedImage.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/android/SkAnimatedImage.h b/include/android/SkAnimatedImage.h
index 1c1a2fc039..d74c6bec49 100644
--- a/include/android/SkAnimatedImage.h
+++ b/include/android/SkAnimatedImage.h
@@ -76,6 +76,17 @@ public:
*/
double update(double msecs);
+ /**
+ * Change the repetition count.
+ *
+ * By default, the image will repeat the number of times indicated in the
+ * encoded data.
+ *
+ * Use SkCodec::kRepetitionCountInfinite for infinite, and 0 to show all
+ * frames once and then stop.
+ */
+ void setRepetitionCount(int count);
+
protected:
SkRect onGetBounds() override;
void onDraw(SkCanvas*) override;
@@ -95,6 +106,7 @@ private:
const SkImageInfo fDecodeInfo;
const SkIRect fCropRect;
const sk_sp<SkPicture> fPostProcess;
+ const int fFrameCount;
const bool fSimple; // no crop, scale, or postprocess
SkMatrix fMatrix; // used only if !fSimple
@@ -104,9 +116,15 @@ private:
double fRemainingMS;
Frame fActiveFrame;
Frame fRestoreFrame;
+ int fRepetitionCount;
+ int fRepetitionsCompleted;
SkAnimatedImage(std::unique_ptr<SkAndroidCodec>, SkISize scaledSize,
SkImageInfo decodeInfo, SkIRect cropRect, sk_sp<SkPicture> postProcess);
+ SkAnimatedImage(std::unique_ptr<SkAndroidCodec>);
+
+ int computeNextFrame(int current, bool* animationEnded);
+ double finish();
typedef SkDrawable INHERITED;
};