Flutter Engine
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/fml/memory/weak_ptr.h"
10 #include "flutter/fml/platform/darwin/scoped_nsobject.h"
11 #include "flutter/shell/common/vsync_waiter.h"
12 
13 @interface DisplayLinkManager : NSObject
14 
15 //------------------------------------------------------------------------------
16 /// @brief The display refresh rate used for reporting purposes. The engine does not care
17 /// about this for frame scheduling. It is only used by tools for instrumentation. The
18 /// engine uses the duration field of the link per frame for frame scheduling.
19 ///
20 /// @attention Do not use the this call in frame scheduling. It is only meant for reporting.
21 ///
22 /// @return The refresh rate in frames per second.
23 ///
24 + (double)displayRefreshRate;
25 
26 @end
27 
28 @interface VSyncClient : NSObject
29 
30 - (instancetype)initWithTaskRunner:(fml::RefPtr<fml::TaskRunner>)task_runner
31  callback:(flutter::VsyncWaiter::Callback)callback;
32 
33 - (void)await;
34 
35 - (void)invalidate;
36 
37 @end
38 
39 namespace flutter {
40 
41 class VsyncWaiterIOS final : public VsyncWaiter {
42  public:
44 
45  ~VsyncWaiterIOS() override;
46 
47  private:
49 
50  // |VsyncWaiter|
51  void AwaitVSync() override;
52 
53  FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS);
54 };
55 
56 } // namespace flutter
57 
58 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_
Definition: ascii_trie.cc:9
VsyncWaiterIOS(flutter::TaskRunners task_runners)