Flutter Engine
VSyncClient Class Reference

#import <vsync_waiter_ios.h>

Inheritance diagram for VSyncClient:

Instance Methods

(instancetype) - initWithTaskRunner:callback:
 
(void) - await
 
(void) - invalidate
 

Detailed Description

Definition at line 30 of file vsync_waiter_ios.h.

Method Documentation

◆ await()

- (void) await

Definition at line 66 of file vsync_waiter_ios.mm.

References display_link_, fml::TimeDelta::FromSecondsF(), fml::TimePoint::Now(), and TRACE_EVENT0.

66  {
67  display_link_.get().paused = NO;
68 }
fml::scoped_nsobject< CADisplayLink > display_link_

◆ initWithTaskRunner:callback:()

- (instancetype) initWithTaskRunner: (fml::RefPtr<fml::TaskRunner>)  task_runner
callback: (flutter::VsyncWaiter::Callback callback 

Definition at line 45 of file vsync_waiter_ios.mm.

References display_link_.

45  :(fml::RefPtr<fml::TaskRunner>)task_runner
46  callback:(flutter::VsyncWaiter::Callback)callback {
47  self = [super init];
48 
49  if (self) {
50  callback_ = std::move(callback);
52  [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]
53  };
54  display_link_.get().paused = YES;
55 
56  task_runner->PostTask([client = [self retain]]() {
57  [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop]
58  forMode:NSRunLoopCommonModes];
59  [client release];
60  });
61  }
62 
63  return self;
64 }
fml::scoped_nsobject< CADisplayLink > display_link_
std::function< void(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)> Callback
Definition: vsync_waiter.h:22
virtual void PostTask(const fml::closure &task)
Definition: task_runner.cc:24

◆ invalidate()

- (void) invalidate

Definition at line 82 of file vsync_waiter_ios.mm.

References display_link_, and invalidate.

Referenced by invalidate.

82  {
83  [display_link_.get() invalidate];
84 }

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