Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::DisplayManager Class Reference

Manages lifecycle of the connected displays. This class is thread-safe. More...

#include <display_manager.h>

Public Member Functions

 DisplayManager ()
 
 ~DisplayManager ()
 
double GetMainDisplayRefreshRate () const
 
void HandleDisplayUpdates (std::vector< std::unique_ptr< Display > > displays)
 Handles the display updates.
 

Detailed Description

Manages lifecycle of the connected displays. This class is thread-safe.

Definition at line 16 of file display_manager.h.

Constructor & Destructor Documentation

◆ DisplayManager()

flutter::DisplayManager::DisplayManager ( )
default

◆ ~DisplayManager()

flutter::DisplayManager::~DisplayManager ( )
default

Member Function Documentation

◆ GetMainDisplayRefreshRate()

double flutter::DisplayManager::GetMainDisplayRefreshRate ( ) const

Returns the display refresh rate of the main display. In cases where there is only one display connected, it will return that. We do not yet support cases where there are multiple displays.

When there are no registered displays, it returns kUnknownDisplayRefreshRate.

Definition at line 16 of file display_manager.cc.

16 {
17 std::scoped_lock lock(displays_mutex_);
18 if (displays_.empty()) {
20 } else {
21 return displays_[0]->GetRefreshRate();
22 }
23}
static constexpr double kUnknownDisplayRefreshRate
To be used when the display refresh rate is unknown.
Definition display.h:20

◆ HandleDisplayUpdates()

void flutter::DisplayManager::HandleDisplayUpdates ( std::vector< std::unique_ptr< Display > >  displays)

Handles the display updates.

Definition at line 25 of file display_manager.cc.

26 {
27 FML_DCHECK(!displays.empty());
28 std::scoped_lock lock(displays_mutex_);
29 displays_ = std::move(displays);
30}
#define FML_DCHECK(condition)
Definition logging.h:103

The documentation for this class was generated from the following files: