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 28 of file vsync_waiter_ios.h.

Method Documentation

◆ await()

- (void) await

Definition at line 70 of file vsync_waiter_ios.mm.

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

70  {
71  display_link_.get().paused = NO;
72 }
fml::scoped_nsobject< CADisplayLink > display_link_

◆ initWithTaskRunner:callback:()

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

Definition at line 49 of file vsync_waiter_ios.mm.

References callback, and display_link_.

49  :(fml::RefPtr<fml::TaskRunner>)task_runner
51  self = [super init];
52 
53  if (self) {
54  callback_ = std::move(callback);
56  [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]
57  };
58  display_link_.get().paused = YES;
59 
60  task_runner->PostTask([client = [self retain]]() {
61  [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop]
62  forMode:NSRunLoopCommonModes];
63  [client release];
64  });
65  }
66 
67  return self;
68 }
fml::scoped_nsobject< CADisplayLink > display_link_
FlKeyEvent FlKeyResponderAsyncCallback callback
std::function< void(std::unique_ptr< FrameTimingsRecorder >)> Callback
Definition: vsync_waiter.h:23
virtual void PostTask(const fml::closure &task) override
Definition: task_runner.cc:24

◆ invalidate()

- (void) invalidate

Definition at line 96 of file vsync_waiter_ios.mm.

References invalidate.

Referenced by invalidate.

96  {
97  [display_link_.get() invalidate];
98 }

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