Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::VsyncWaiterAndroid Class Referencefinal

#include <vsync_waiter_android.h>

Inheritance diagram for flutter::VsyncWaiterAndroid:
flutter::VsyncWaiter

Public Member Functions

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

Static Public Member Functions

static bool Register (JNIEnv *env)
 

Additional Inherited Members

- Public Types inherited from flutter::VsyncWaiter
using Callback = std::function< void(std::unique_ptr< FrameTimingsRecorder >)>
 
- Protected Member Functions inherited from flutter::VsyncWaiter
 VsyncWaiter (const TaskRunners &task_runners)
 
virtual void AwaitVSync ()=0
 
virtual void AwaitVSyncForSecondaryCallback ()
 
void FireCallback (fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
 
- Protected Attributes inherited from flutter::VsyncWaiter
const TaskRunners task_runners_
 

Detailed Description

Definition at line 19 of file vsync_waiter_android.h.

Constructor & Destructor Documentation

◆ VsyncWaiterAndroid()

flutter::VsyncWaiterAndroid::VsyncWaiterAndroid ( const flutter::TaskRunners task_runners)
explicit

Definition at line 24 of file vsync_waiter_android.cc.

25 : VsyncWaiter(task_runners) {}
VsyncWaiter(const TaskRunners &task_runners)
Definition: vsync_waiter.cc:21

◆ ~VsyncWaiterAndroid()

flutter::VsyncWaiterAndroid::~VsyncWaiterAndroid ( )
overridedefault

Member Function Documentation

◆ Register()

bool flutter::VsyncWaiterAndroid::Register ( JNIEnv *  env)
static

Definition at line 122 of file vsync_waiter_android.cc.

122 {
123 static const JNINativeMethod methods[] = {
124 {
125 .name = "nativeOnVsync",
126 .signature = "(JJJ)V",
127 .fnPtr = reinterpret_cast<void*>(&OnVsyncFromJava),
128 },
129 {
130 .name = "nativeUpdateRefreshRate",
131 .signature = "(F)V",
132 .fnPtr = reinterpret_cast<void*>(&OnUpdateRefreshRate),
133 }};
134
135 jclass clazz = env->FindClass("io/flutter/embedding/engine/FlutterJNI");
136
137 if (clazz == nullptr) {
138 return false;
139 }
140
142 FML_CHECK(!g_vsync_waiter_class->is_null());
143
144 g_async_wait_for_vsync_method_ = env->GetStaticMethodID(
145 g_vsync_waiter_class->obj(), "asyncWaitForVsync", "(J)V");
147
148 return env->RegisterNatives(clazz, methods, fml::size(methods)) == 0;
149}
#define FML_CHECK(condition)
Definition: logging.h:85
Definition: __init__.py:1
static fml::jni::ScopedJavaGlobalRef< jclass > * g_vsync_waiter_class
static jmethodID g_async_wait_for_vsync_method_
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

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