KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Signals | Public Member Functions | Friends | List of all members
KWin::RenderLoop Class Reference

#include <renderloop.h>

Inheritance diagram for KWin::RenderLoop:

Signals

void refreshRateChanged ()
 
void framePresented (RenderLoop *loop, std::chrono::nanoseconds timestamp, PresentationMode mode)
 
void frameRequested (RenderLoop *loop)
 

Public Member Functions

 RenderLoop (Output *output)
 
 ~RenderLoop () override
 
void inhibit ()
 
void uninhibit ()
 
void prepareNewFrame ()
 
void beginPaint ()
 
int refreshRate () const
 
void setRefreshRate (int refreshRate)
 
void setPresentationSafetyMargin (std::chrono::nanoseconds safetyMargin)
 
void scheduleRepaint (Item *item=nullptr)
 
std::chrono::nanoseconds lastPresentationTimestamp () const
 
std::chrono::nanoseconds nextPresentationTimestamp () const
 
void setPresentationMode (PresentationMode mode)
 

Friends

class RenderLoopPrivate
 

Detailed Description

The RenderLoop class represents the compositing scheduler on a particular output.

The RenderLoop class drives the compositing. The frameRequested() signal is emitted when the loop wants a new frame to be rendered. The frameCompleted() signal is emitted when a previously rendered frame has been presented on the screen. In case you want the compositor to repaint the scene, call the scheduleRepaint() function.

Definition at line 29 of file renderloop.h.

Constructor & Destructor Documentation

◆ RenderLoop()

KWin::RenderLoop::RenderLoop ( Output * output)
explicit

Definition at line 142 of file renderloop.cpp.

◆ ~RenderLoop()

KWin::RenderLoop::~RenderLoop ( )
override

Definition at line 147 of file renderloop.cpp.

Member Function Documentation

◆ beginPaint()

void KWin::RenderLoop::beginPaint ( )

This function must be called before the Compositor starts rendering the next frame.

Definition at line 175 of file renderloop.cpp.

◆ framePresented

void KWin::RenderLoop::framePresented ( RenderLoop * loop,
std::chrono::nanoseconds timestamp,
PresentationMode mode )
signal

This signal is emitted when a frame has been actually presented on the screen. timestamp indicates the time when it took place.

◆ frameRequested

void KWin::RenderLoop::frameRequested ( RenderLoop * loop)
signal

This signal is emitted when the render loop wants a new frame to be composited.

The Compositor should make a connection to this signal using Qt::DirectConnection.

◆ inhibit()

void KWin::RenderLoop::inhibit ( )

Pauses the render loop. While the render loop is inhibited, scheduleRepaint() requests are queued.

Once the render loop is uninhibited, the pending schedule requests are going to be re-applied.

Definition at line 151 of file renderloop.cpp.

◆ lastPresentationTimestamp()

std::chrono::nanoseconds KWin::RenderLoop::lastPresentationTimestamp ( ) const

Returns the timestamp of the last frame that has been presented on the screen. The returned timestamp is sourced from the monotonic clock.

Definition at line 218 of file renderloop.cpp.

◆ nextPresentationTimestamp()

std::chrono::nanoseconds KWin::RenderLoop::nextPresentationTimestamp ( ) const

If a repaint has been scheduled, this function returns the expected time when the next frame will be presented on the screen. The returned timestamp is sourced from the monotonic clock.

Definition at line 223 of file renderloop.cpp.

◆ prepareNewFrame()

void KWin::RenderLoop::prepareNewFrame ( )

This function must be called before the Compositor sumbits the next frame.

Definition at line 170 of file renderloop.cpp.

◆ refreshRate()

int KWin::RenderLoop::refreshRate ( ) const

Returns the refresh rate at which the output is being updated, in millihertz.

Definition at line 180 of file renderloop.cpp.

◆ refreshRateChanged

void KWin::RenderLoop::refreshRateChanged ( )
signal

This signal is emitted when the refresh rate of this RenderLoop has changed.

◆ scheduleRepaint()

void KWin::RenderLoop::scheduleRepaint ( Item * item = nullptr)

Schedules a compositing cycle at the next available moment.

Definition at line 199 of file renderloop.cpp.

◆ setPresentationMode()

void KWin::RenderLoop::setPresentationMode ( PresentationMode mode)

Definition at line 228 of file renderloop.cpp.

◆ setPresentationSafetyMargin()

void KWin::RenderLoop::setPresentationSafetyMargin ( std::chrono::nanoseconds safetyMargin)

Definition at line 194 of file renderloop.cpp.

◆ setRefreshRate()

void KWin::RenderLoop::setRefreshRate ( int refreshRate)

Sets the refresh rate of this RenderLoop to refreshRate, in millihertz.

Definition at line 185 of file renderloop.cpp.

◆ uninhibit()

void KWin::RenderLoop::uninhibit ( )

Uninhibits the render loop.

Definition at line 160 of file renderloop.cpp.

Friends And Related Symbol Documentation

◆ RenderLoopPrivate

friend class RenderLoopPrivate
friend

Definition at line 115 of file renderloop.h.


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