5#ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_
6#define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_
11#include <unordered_map>
13#include "flutter/common/task_runners.h"
14#include "flutter/flow/frame_timings.h"
15#include "flutter/fml/time/time_point.h"
24class VsyncWaiter :
public std::enable_shared_from_this<VsyncWaiter> {
75 bool pause_secondary_tasks =
true);
78 std::mutex callback_mutex_;
80 std::unordered_map<uintptr_t, fml::closure> secondary_callbacks_;
82 void PauseDartEventLoopTasks();
void ScheduleSecondaryCallback(uintptr_t id, const fml::closure &callback)
std::function< void(std::unique_ptr< FrameTimingsRecorder >)> Callback
VsyncWaiter(const TaskRunners &task_runners)
virtual void AwaitVSync()=0
void AsyncWaitForVsync(const Callback &callback)
void FireCallback(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
virtual void AwaitVSyncForSecondaryCallback()
const TaskRunners task_runners_
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Dart_NativeFunction function
std::function< void()> closure