5#ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_
6#define FLUTTER_SHELL_COMMON_ANIMATOR_H_
35 uint64_t frame_number) = 0;
45 std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder) = 0;
50 std::unique_ptr<VsyncWaiter> waiter);
87 std::unique_ptr<flutter::LayerTree> layer_tree,
88 float device_pixel_ratio);
121 void BeginFrame(std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder);
124 bool CanReuseLastLayerTrees();
126 void DrawLastLayerTrees(
127 std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder);
132 void ScheduleMaybeClearTraceFlowIds();
136 std::shared_ptr<VsyncWaiter> waiter_;
138 std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder_;
139 std::unordered_map<int64_t, std::unique_ptr<LayerTreeTask>>
141 uint64_t frame_request_number_ = 1;
143 std::shared_ptr<FramePipeline> layer_tree_pipeline_;
145 FramePipeline::ProducerContinuation producer_continuation_;
146 bool regenerate_layer_trees_ =
false;
147 bool frame_scheduled_ =
false;
148 std::deque<uint64_t> trace_flow_ids_;
149 bool has_rendered_ =
false;
virtual void OnAnimatorNotifyIdle(fml::TimeDelta deadline)=0
virtual void OnAnimatorBeginFrame(fml::TimePoint frame_target_time, uint64_t frame_number)=0
virtual void OnAnimatorDrawLastLayerTrees(std::unique_ptr< FrameTimingsRecorder > frame_timings_recorder)=0
virtual void OnAnimatorUpdateLatestFrameTargetTime(fml::TimePoint frame_target_time)=0
virtual void OnAnimatorDraw(std::shared_ptr< FramePipeline > pipeline)=0
void ScheduleSecondaryVsyncCallback(uintptr_t id, const fml::closure &callback)
Schedule a secondary callback to be executed right after the main VsyncWaiter::AsyncWaitForVsync call...
void Render(int64_t view_id, std::unique_ptr< flutter::LayerTree > layer_tree, float device_pixel_ratio)
Tells the Animator that this frame needs to render another view.
void EnqueueTraceFlowId(uint64_t trace_flow_id)
void RequestFrame(bool regenerate_layer_trees=true)
const std::weak_ptr< VsyncWaiter > GetVsyncWaiter() const
void OnAllViewsRendered()
Tells the Animator that all views that should render for this frame have been rendered.
A traditional counting semaphore. Waits decrement the counter and Signal increments it.
G_BEGIN_DECLS FlutterViewId view_id
FlutterDesktopBinaryReply callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
std::function< void()> closure