42 explicit State(std::shared_ptr<ImageGenerator> generator);
44 const std::shared_ptr<ImageGenerator> generator_;
45 const int frameCount_;
46 const int repetitionCount_;
47 bool is_impeller_enabled_ =
false;
52 int nextFrameIndex_ = 0;
54 std::optional<SkBitmap> lastRequiredFrame_;
56 int lastRequiredFrameIndex_ = -1;
60 std::optional<SkIRect> restoreBGColorRect_;
62 std::pair<sk_sp<DlImage>, std::string> GetNextFrameImage(
64 const std::shared_ptr<const fml::SyncSwitch>& gpu_disable_sync_switch,
65 const std::shared_ptr<impeller::Context>& impeller_context,
68 void GetNextFrameAndInvokeCallback(
69 std::unique_ptr<tonic::DartPersistentValue>
callback,
73 const std::shared_ptr<const fml::SyncSwitch>& gpu_disable_sync_switch,
75 const std::shared_ptr<impeller::Context>& impeller_context);
79 std::shared_ptr<State> state_;