Mir
Public Member Functions | Protected Member Functions | List of all members
mir::graphics::DisplaySyncGroup Class Referenceabstract

DisplaySyncGroup represents a group of displays that need to be output in unison as a single post() call. More...

#include <display.h>

Inheritance diagram for mir::graphics::DisplaySyncGroup:
[legend]

Public Member Functions

virtual void for_each_display_buffer (std::function< void(DisplayBuffer &)> const &f)=0
 Executes a functor that allows the DisplayBuffer contents to be updated. More...
 
virtual void post ()=0
 Post the content of the DisplayBuffers associated with this DisplaySyncGroup. More...
 
virtual std::chrono::milliseconds recommended_sleep () const =0
 Returns a recommendation to the compositor as to how long it should wait before sampling the scene for the next frame. More...
 
virtual ~DisplaySyncGroup ()=default
 

Protected Member Functions

 DisplaySyncGroup ()=default
 
 DisplaySyncGroup (DisplaySyncGroup const &)=delete
 
DisplaySyncGroupoperator= (DisplaySyncGroup const &)=delete
 

Detailed Description

DisplaySyncGroup represents a group of displays that need to be output in unison as a single post() call.

This is only appropriate for platforms whose post() calls are non-blocking and not synchronous with the screen hardware (e.g. virtual machines or Android). Using a DisplaySyncGroup with multiple screens on a platform whose post() blocks for vsync often results in stuttering, and so should be avoided. Although using DisplaySyncGroup with a single DisplayBuffer remains safe for any platform.

Examples:
render_surfaces.cpp.

Constructor & Destructor Documentation

virtual mir::graphics::DisplaySyncGroup::~DisplaySyncGroup ( )
virtualdefault
mir::graphics::DisplaySyncGroup::DisplaySyncGroup ( )
protecteddefault
mir::graphics::DisplaySyncGroup::DisplaySyncGroup ( DisplaySyncGroup const &  )
protecteddelete

Member Function Documentation

virtual void mir::graphics::DisplaySyncGroup::for_each_display_buffer ( std::function< void(DisplayBuffer &)> const &  f)
pure virtual

Executes a functor that allows the DisplayBuffer contents to be updated.

Examples:
render_surfaces.cpp.
DisplaySyncGroup& mir::graphics::DisplaySyncGroup::operator= ( DisplaySyncGroup const &  )
protecteddelete
virtual void mir::graphics::DisplaySyncGroup::post ( )
pure virtual

Post the content of the DisplayBuffers associated with this DisplaySyncGroup.

The content of all the DisplayBuffers in this DisplaySyncGroup are guaranteed to be onscreen in the near future. On some platforms, this may wait a potentially long time for vsync.

Implemented in mir::graphics::nested::detail::DisplaySyncGroup, mir::graphics::mesa::DisplayBuffer, mir::graphics::android::DisplayGroup, and mir::graphics::X::DisplayGroup.

virtual std::chrono::milliseconds mir::graphics::DisplaySyncGroup::recommended_sleep ( ) const
pure virtual

Returns a recommendation to the compositor as to how long it should wait before sampling the scene for the next frame.

Sampling the scene too early results in up to one whole frame of extra lag if rendering is fast or skipped altogether (bypass/overlays). But sampling too late and we might miss the deadline. If unsure just return zero.

Implemented in mir::graphics::nested::detail::DisplaySyncGroup, mir::graphics::mesa::DisplayBuffer, mir::graphics::android::DisplayGroup, and mir::graphics::X::DisplayGroup.


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

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016