Flutter Engine
The Flutter Engine
Instance Methods | Protected Attributes | List of all members
FlutterTimeConverter Class Reference

Converts between the time representation used by Flutter Engine and CAMediaTime. More...

#import <FlutterTimeConverter.h>

Inheritance diagram for FlutterTimeConverter:

Instance Methods

(instancetype) - initWithEngine:
 
(uint64_t) - CAMediaTimeToEngineTime:
 
(CFTimeInterval) - engineTimeToCAMediaTime:
 

Protected Attributes

__weak FlutterEngine_engine
 

Detailed Description

Converts between the time representation used by Flutter Engine and CAMediaTime.

Definition at line 13 of file FlutterTimeConverter.h.

Method Documentation

◆ CAMediaTimeToEngineTime:

- (uint64_t) CAMediaTimeToEngineTime: (CFTimeInterval)  time

Definition at line 12 of file FlutterTimeConverter.mm.

26 :(CFTimeInterval)time {
28 if (!engine) {
29 return 0;
30 }
31 return (time - CACurrentMediaTime()) * NSEC_PER_SEC + engine.embedderAPI.GetCurrentTime();
32}
FlutterEngine engine
Definition: main.cc:68
FlutterEngineProcTable & embedderAPI()
__weak FlutterEngine * _engine
static double time(int loops, Benchmark *bench, Target *target)
Definition: nanobench.cpp:394
FlutterEngineGetCurrentTimeFnPtr GetCurrentTime
Definition: embedder.h:3352
#define NSEC_PER_SEC
Definition: timerfd.cc:35

◆ engineTimeToCAMediaTime:

- (CFTimeInterval) engineTimeToCAMediaTime: (uint64_t)  time

Definition at line 12 of file FlutterTimeConverter.mm.

34 :(uint64_t)time {
36 if (!engine) {
37 return 0;
38 }
39 return (static_cast<int64_t>(time) - static_cast<int64_t>(engine.embedderAPI.GetCurrentTime())) /
40 static_cast<double>(NSEC_PER_SEC) +
41 CACurrentMediaTime();
42}
#define GetCurrentTime()

◆ initWithEngine:

- (instancetype) initWithEngine: (FlutterEngine*)  engine

Definition at line 12 of file FlutterTimeConverter.mm.

19 self = [super init];
20 if (self) {
22 }
23 return self;
24}

Member Data Documentation

◆ _engine

- (__weak FlutterEngine*) _engine
protected

Definition at line 12 of file FlutterTimeConverter.mm.


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