mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef SHELL_PLATFORM_EMBEDDER_VSYNC_WAITER_EMBEDDER_H_
|
|
#define SHELL_PLATFORM_EMBEDDER_VSYNC_WAITER_EMBEDDER_H_
|
|
|
|
#include "flutter/fml/macros.h"
|
|
#include "flutter/shell/common/vsync_waiter.h"
|
|
|
|
namespace flutter {
|
|
|
|
class VsyncWaiterEmbedder final : public VsyncWaiter {
|
|
public:
|
|
using VsyncCallback = std::function<void(intptr_t)>;
|
|
|
|
VsyncWaiterEmbedder(VsyncCallback callback,
|
|
flutter::TaskRunners task_runners);
|
|
|
|
~VsyncWaiterEmbedder() override;
|
|
|
|
static bool OnEmbedderVsync(intptr_t baton,
|
|
fml::TimePoint frame_start_time,
|
|
fml::TimePoint frame_target_time);
|
|
|
|
private:
|
|
const VsyncCallback vsync_callback_;
|
|
|
|
// |VsyncWaiter|
|
|
void AwaitVSync() override;
|
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterEmbedder);
|
|
};
|
|
|
|
} // namespace flutter
|
|
|
|
#endif // SHELL_PLATFORM_EMBEDDER_VSYNC_WAITER_EMBEDDER_H_
|