flutter_flutter/shell/platform/android/vsync_waiter_android.h
liyuqian 2bd75ae8ba
Support querying display refresh rate in engine (#7002)
The current implementation only deals with Android devices and we'll add iOS devices support soon.
2018-12-12 10:28:44 -08:00

36 lines
896 B
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_ANDROID_VSYNC_WAITER_ANDROID_H_
#define SHELL_PLATFORM_ANDROID_VSYNC_WAITER_ANDROID_H_
#include <jni.h>
#include <memory>
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/shell/common/vsync_waiter.h"
namespace shell {
class VsyncWaiterAndroid final : public VsyncWaiter {
public:
static bool Register(JNIEnv* env);
VsyncWaiterAndroid(blink::TaskRunners task_runners);
~VsyncWaiterAndroid() override;
float GetDisplayRefreshRate() const override;
private:
// |shell::VsyncWaiter|
void AwaitVSync() override;
FML_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid);
};
} // namespace shell
#endif // SHELL_PLATFORM_ANDROID_ASYNC_WAITER_ANDROID_H_