Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
android_display.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_ANDROID_ANDROID_DISPLAY_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_DISPLAY_H_
7
8#include <cstdint>
9
10#include "flutter/fml/macros.h"
11#include "flutter/shell/common/display.h"
12#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
13
14namespace flutter {
15
16/// A |Display| that listens to refresh rate changes.
17class AndroidDisplay : public Display {
18 public:
19 explicit AndroidDisplay(std::shared_ptr<PlatformViewAndroidJNI> jni_facade);
20 ~AndroidDisplay() = default;
21
22 // |Display|
23 double GetRefreshRate() const override;
24
25 // |Display|
26 virtual double GetWidth() const override;
27
28 // |Display|
29 virtual double GetHeight() const override;
30
31 // |Display|
32 virtual double GetDevicePixelRatio() const override;
33
34 private:
35 std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;
36
38};
39
40} // namespace flutter
41
42#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_DISPLAY_H_
A |Display| that listens to refresh rate changes.
virtual double GetDevicePixelRatio() const override
The device pixel ratio of the display.
virtual double GetWidth() const override
The width of the display in physical pixels.
virtual double GetHeight() const override
The height of the display in physical pixels.
double GetRefreshRate() const override
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27