flutter_flutter/shell/platform/embedder/vsync_waiter_embedder.h
gaaclarke 89e395853c
Refactor to passing functions by const ref (#13975)
Moved our code to passing functions by const ref
2019-11-22 12:20:02 -08:00

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(const 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_