Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
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
17namespace flutter {
18
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
33 return GetInitialRefreshRate(refresh_rate_reporter_);
34}
35
36} // namespace flutter
reporter
VariableRefreshRateDisplay(DisplayId display_id, const std::weak_ptr< VariableRefreshRateReporter > &refresh_rate_reporter, double width, double height, double device_pixel_ratio)
size_t DisplayId
Definition display.h:17
int32_t height
int32_t width
static double GetInitialRefreshRate(const std::weak_ptr< flutter::VariableRefreshRateReporter > &refresh_rate_reporter)