9#include <lib/async/default.h>
11#include "flutter/fml/logging.h"
12#include "flutter/fml/make_copyable.h"
13#include "flutter/fml/synchronization/waitable_event.h"
14#include "flutter/fml/time/time_delta.h"
15#include "flutter/fml/trace_event.h"
23 await_vsync_for_secondary_callback_callback,
26 await_vsync_callback_(await_vsync_callback),
27 await_vsync_for_secondary_callback_callback_(
28 await_vsync_for_secondary_callback_callback),
29 weak_factory_ui_(nullptr),
52 std::make_unique<fml::WeakPtrFactory<VsyncWaiter>>(this);
53 weak_ui_ = weak_factory_ui_->GetWeakPtr();
62 [weak_factory_ui = std::move(weak_factory_ui_), &ui_latch]()
mutable {
63 weak_factory_ui.reset();
69void VsyncWaiter::AwaitVSync() {
70 await_vsync_callback_(fire_callback_callback_);
73void VsyncWaiter::AwaitVSyncForSecondaryCallback() {
74 await_vsync_for_secondary_callback_callback_(fire_callback_callback_);
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
const TaskRunners task_runners_
VsyncWaiter(AwaitVsyncCallback await_vsync_callback, AwaitVsyncForSecondaryCallbackCallback await_vsync_for_secondary_callback_callback, flutter::TaskRunners task_runners)
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
virtual void PostTaskForTime(const fml::closure &task, fml::TimePoint target_time)
std::function< void(FireCallbackCallback)> AwaitVsyncForSecondaryCallbackCallback
std::function< void(FireCallbackCallback)> AwaitVsyncCallback
internal::CopyableLambda< T > MakeCopyable(T lambda)