Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
common
variable_refresh_rate_display.cc
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
#include "flutter/shell/common/variable_refresh_rate_display.h"
6
#include "flutter/fml/logging.h"
7
8
static
double
GetInitialRefreshRate
(
9
const
std::weak_ptr<flutter::VariableRefreshRateReporter>&
10
refresh_rate_reporter) {
11
if
(
auto
reporter
= refresh_rate_reporter.lock()) {
12
return
reporter
->GetRefreshRate();
13
}
14
return
0;
15
}
16
17
namespace
flutter
{
18
19
VariableRefreshRateDisplay::VariableRefreshRateDisplay
(
20
DisplayId
display_id,
21
const
std::weak_ptr<VariableRefreshRateReporter>& refresh_rate_reporter,
22
double
width
,
23
double
height
,
24
double
device_pixel_ratio)
25
:
Display
(display_id,
26
GetInitialRefreshRate
(refresh_rate_reporter),
27
width
,
28
height
,
29
device_pixel_ratio),
30
refresh_rate_reporter_(refresh_rate_reporter) {}
31
32
double
VariableRefreshRateDisplay::GetRefreshRate
()
const
{
33
return
GetInitialRefreshRate
(refresh_rate_reporter_);
34
}
35
36
}
// namespace flutter
reporter
reporter
Definition
FontMgrTest.cpp:39
flutter::Display
Definition
display.h:35
flutter::VariableRefreshRateDisplay::VariableRefreshRateDisplay
VariableRefreshRateDisplay(DisplayId display_id, const std::weak_ptr< VariableRefreshRateReporter > &refresh_rate_reporter, double width, double height, double device_pixel_ratio)
Definition
variable_refresh_rate_display.cc:19
flutter::VariableRefreshRateDisplay::GetRefreshRate
double GetRefreshRate() const override
Definition
variable_refresh_rate_display.cc:32
flutter
Definition
asset_manager.cc:10
flutter::DisplayId
size_t DisplayId
Definition
display.h:17
height
int32_t height
Definition
serialization_callbacks.cc:1
width
int32_t width
Definition
serialization_callbacks.cc:0
GetInitialRefreshRate
static double GetInitialRefreshRate(const std::weak_ptr< flutter::VariableRefreshRateReporter > &refresh_rate_reporter)
Definition
variable_refresh_rate_display.cc:8
Generated on Fri Apr 26 2024 06:14:19 for Flutter Engine by
1.9.8