Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::ShellTestVsyncClock Class Reference

#include <vsync_waiters_test.h>

Public Member Functions

void SimulateVSync ()
 Simulate that a vsync signal is triggered. More...
 
std::future< intNextVSync ()
 A future that will return the index the next vsync signal. More...
 

Detailed Description

Definition at line 19 of file vsync_waiters_test.h.

Member Function Documentation

◆ NextVSync()

std::future< int > flutter::testing::ShellTestVsyncClock::NextVSync ( )

A future that will return the index the next vsync signal.

Definition at line 29 of file vsync_waiters_test.cc.

29 {
30 std::scoped_lock lock(mutex_);
31 vsync_promised_.emplace_back();
32 return vsync_promised_.back().get_future();
33}

◆ SimulateVSync()

void flutter::testing::ShellTestVsyncClock::SimulateVSync ( )

Simulate that a vsync signal is triggered.

Definition at line 19 of file vsync_waiters_test.cc.

19 {
20 std::scoped_lock lock(mutex_);
21 if (vsync_issued_ >= vsync_promised_.size()) {
22 vsync_promised_.emplace_back();
23 }
24 FML_CHECK(vsync_issued_ < vsync_promised_.size());
25 vsync_promised_[vsync_issued_].set_value(vsync_issued_);
26 vsync_issued_ += 1;
27}
#define FML_CHECK(condition)
Definition: logging.h:85

The documentation for this class was generated from the following files: