Flutter Engine
flutter::VsyncWaiterEmbedder Class Referencefinal

#include <vsync_waiter_embedder.h>

Inheritance diagram for flutter::VsyncWaiterEmbedder:
flutter::VsyncWaiter

Public Types

using VsyncCallback = std::function< void(intptr_t)>
 
- Public Types inherited from flutter::VsyncWaiter
using Callback = std::function< void(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)>
 

Public Member Functions

 VsyncWaiterEmbedder (const VsyncCallback &callback, flutter::TaskRunners task_runners)
 
 ~VsyncWaiterEmbedder () override
 
- Public Member Functions inherited from flutter::VsyncWaiter
virtual ~VsyncWaiter ()
 
void AsyncWaitForVsync (const Callback &callback)
 
void ScheduleSecondaryCallback (const fml::closure &callback)
 

Static Public Member Functions

static bool OnEmbedderVsync (intptr_t baton, fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::VsyncWaiter
 VsyncWaiter (TaskRunners task_runners)
 
void FireCallback (fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)
 
- Protected Attributes inherited from flutter::VsyncWaiter
const TaskRunners task_runners_
 

Detailed Description

Definition at line 13 of file vsync_waiter_embedder.h.

Member Typedef Documentation

◆ VsyncCallback

Definition at line 15 of file vsync_waiter_embedder.h.

Constructor & Destructor Documentation

◆ VsyncWaiterEmbedder()

flutter::VsyncWaiterEmbedder::VsyncWaiterEmbedder ( const VsyncCallback callback,
flutter::TaskRunners  task_runners 
)

Definition at line 9 of file vsync_waiter_embedder.cc.

References FML_DCHECK, and ~VsyncWaiterEmbedder().

11  : VsyncWaiter(std::move(task_runners)), vsync_callback_(vsync_callback) {
12  FML_DCHECK(vsync_callback_);
13 }
VsyncWaiter(TaskRunners task_runners)
Definition: vsync_waiter.cc:32
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ ~VsyncWaiterEmbedder()

flutter::VsyncWaiterEmbedder::~VsyncWaiterEmbedder ( )
overridedefault

Referenced by VsyncWaiterEmbedder().

Member Function Documentation

◆ OnEmbedderVsync()

bool flutter::VsyncWaiterEmbedder::OnEmbedderVsync ( intptr_t  baton,
fml::TimePoint  frame_start_time,
fml::TimePoint  frame_target_time 
)
static

Definition at line 24 of file vsync_waiter_embedder.cc.

Referenced by flutter::EmbedderEngine::OnVsyncEvent().

26  {
27  if (baton == 0) {
28  return false;
29  }
30 
31  auto* weak_waiter = reinterpret_cast<std::weak_ptr<VsyncWaiter>*>(baton);
32  auto strong_waiter = weak_waiter->lock();
33  delete weak_waiter;
34 
35  if (!strong_waiter) {
36  return false;
37  }
38 
39  strong_waiter->FireCallback(frame_start_time, frame_target_time);
40  return true;
41 }

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