Flutter Engine
flutter::VsyncWaiterAndroid Class Referencefinal

#include <vsync_waiter_android.h>

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

Public Member Functions

 VsyncWaiterAndroid (flutter::TaskRunners task_runners)
 
 ~VsyncWaiterAndroid () 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 Register (JNIEnv *env)
 

Additional Inherited Members

- Public Types inherited from flutter::VsyncWaiter
using Callback = std::function< void(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)>
 
- 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 17 of file vsync_waiter_android.h.

Constructor & Destructor Documentation

◆ VsyncWaiterAndroid()

◆ ~VsyncWaiterAndroid()

flutter::VsyncWaiterAndroid::~VsyncWaiterAndroid ( )
overridedefault

Referenced by VsyncWaiterAndroid().

Member Function Documentation

◆ Register()

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

Definition at line 72 of file vsync_waiter_android.cc.

References FML_CHECK, fml::jni::JavaRef< T >::obj(), and fml::size().

Referenced by JNI_OnLoad().

72  {
73  static const JNINativeMethod methods[] = {{
74  .name = "nativeOnVsync",
75  .signature = "(JJJ)V",
76  .fnPtr = reinterpret_cast<void*>(&OnNativeVsync),
77  }};
78 
79  jclass clazz = env->FindClass("io/flutter/embedding/engine/FlutterJNI");
80 
81  if (clazz == nullptr) {
82  return false;
83  }
84 
86 
87  FML_CHECK(!g_vsync_waiter_class->is_null());
88 
89  g_async_wait_for_vsync_method_ = env->GetStaticMethodID(
90  g_vsync_waiter_class->obj(), "asyncWaitForVsync", "(J)V");
91 
92  FML_CHECK(g_async_wait_for_vsync_method_ != nullptr);
93 
94  return env->RegisterNatives(clazz, methods, fml::size(methods)) == 0;
95 }
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
#define FML_CHECK(condition)
Definition: logging.h:68

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