Flutter Engine
The Flutter Engine
vsync_waiter_fallback.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_COMMON_VSYNC_WAITER_FALLBACK_H_
6#define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/fml/memory/weak_ptr.h"
10#include "flutter/fml/time/time_point.h"
11#include "flutter/shell/common/vsync_waiter.h"
12
13namespace flutter {
14
15/// A |VsyncWaiter| that will fire at 60 fps irrespective of the vsync.
16class VsyncWaiterFallback final : public VsyncWaiter {
17 public:
18 explicit VsyncWaiterFallback(const TaskRunners& task_runners,
19 bool for_testing = false);
20
22
23 private:
24 fml::TimePoint phase_;
25 const bool for_testing_;
26
27 // |VsyncWaiter|
28 void AwaitVSync() override;
29
30 FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback);
31};
32
33} // namespace flutter
34
35#endif // FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_
A |VsyncWaiter| that will fire at 60 fps irrespective of the vsync.
VsyncWaiterFallback(const TaskRunners &task_runners, bool for_testing=false)