5#define FML_USED_ON_EMBEDDER
7#include "flutter/shell/common/shell_test.h"
9#include "flutter/flow/layers/layer_tree.h"
10#include "flutter/flow/layers/transform_layer.h"
11#include "flutter/fml/make_copyable.h"
12#include "flutter/fml/mapping.h"
13#include "flutter/runtime/dart_vm.h"
14#include "flutter/testing/testing.h"
20 std::scoped_lock lock(mutex_);
21 if (vsync_issued_ >= vsync_promised_.size()) {
22 vsync_promised_.emplace_back();
24 FML_CHECK(vsync_issued_ < vsync_promised_.size());
25 vsync_promised_[vsync_issued_].set_value(vsync_issued_);
30 std::scoped_lock lock(mutex_);
31 vsync_promised_.emplace_back();
32 return vsync_promised_.back().get_future();
37 auto vsync_future = clock_->NextVSync();
39 auto async_wait = std::async([&vsync_future,
this]() {
61 auto async_wait = std::async([
this]() {
68 : refresh_rate_(refresh_rate) {}
71 refresh_rate_ = refresh_rate;
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
fml::RefPtr< fml::TaskRunner > GetPlatformTaskRunner() const
void FireCallback(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
const TaskRunners task_runners_
static constexpr fml::TimePoint kFrameTargetTime
static constexpr fml::TimePoint kFrameBeginTime
void AwaitVSync() override
std::future< int > NextVSync()
A future that will return the index the next vsync signal.
void SimulateVSync()
Simulate that a vsync signal is triggered.
void AwaitVSync() override
double GetRefreshRate() const override
TestRefreshRateReporter(double refresh_rate)
void UpdateRefreshRate(double refresh_rate)
virtual bool RunsTasksOnCurrentThread()
#define FML_CHECK(condition)
#define FML_DCHECK(condition)