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