Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
vsync_waiter_ios.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_
6
#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_
7
8
#include "
flutter/fml/macros.h
"
9
#include "
flutter/shell/common/variable_refresh_rate_reporter.h
"
10
#include "
flutter/shell/common/vsync_waiter.h
"
11
#import "
flutter/shell/platform/darwin/ios/framework/Source/FlutterVSyncClient.h
"
12
13
namespace
flutter
{
14
15
class
VsyncWaiterIOS
final :
public
VsyncWaiter
,
16
public
VariableRefreshRateReporter
{
17
public
:
18
explicit
VsyncWaiterIOS
(
const
flutter::TaskRunners
& task_runners);
19
20
~VsyncWaiterIOS
()
override
;
21
22
// |VariableRefreshRateReporter|
23
double
GetRefreshRate
()
const override
;
24
25
// @brief Snaps the duration to the nearest whole Hz value and provides safe
26
// fallbacks. This ensures we don't introduce frame timing issues due
27
// to floating point error. e.g.
28
// 59.998, 60.004, 59.995, ... --> 60.000
29
//
30
// Additionally, guards against divide-by-zero and non-positive
31
// durations, which can occur on paused/unpaused transitions.
32
//
33
// Visible for testing.
34
static
CFTimeInterval
SnapDuration
(CFTimeInterval duration,
35
double
max_refresh_rate);
36
37
private
:
38
// |VsyncWaiter|
39
// Made public for testing.
40
void
AwaitVSync()
override
;
41
42
private
:
43
FlutterVSyncClient
* client_;
44
double
max_refresh_rate_;
45
46
FML_DISALLOW_COPY_AND_ASSIGN
(
VsyncWaiterIOS
);
47
};
48
49
}
// namespace flutter
50
51
#endif
// FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_
FlutterVSyncClient.h
flutter::TaskRunners
Definition
task_runners.h:15
flutter::VariableRefreshRateReporter
Definition
variable_refresh_rate_reporter.h:17
flutter::VsyncWaiter
Definition
vsync_waiter.h:24
flutter::VsyncWaiterIOS
Definition
vsync_waiter_ios.h:16
flutter::VsyncWaiterIOS::~VsyncWaiterIOS
~VsyncWaiterIOS() override
Definition
vsync_waiter_ios.mm:48
flutter::VsyncWaiterIOS::SnapDuration
static CFTimeInterval SnapDuration(CFTimeInterval duration, double max_refresh_rate)
Definition
vsync_waiter_ios.mm:68
flutter::VsyncWaiterIOS::GetRefreshRate
double GetRefreshRate() const override
Definition
vsync_waiter_ios.mm:64
vsync_waiter.h
macros.h
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
FlutterVSyncClient
A client that wraps a CADisplayLink to deliver synchronized vsync signals.
Definition
FlutterVSyncClient.h:65
flutter
Definition
asset_manager.cc:10
variable_refresh_rate_reporter.h
shell
platform
darwin
ios
framework
Source
vsync_waiter_ios.h
Generated on Mon May 25 2026 06:07:38 for Flutter Engine Uber Docs by
1.9.8