KWin
|
#include <renderloop.h>
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 |
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.
|
explicit |
Definition at line 142 of file renderloop.cpp.
|
override |
Definition at line 147 of file renderloop.cpp.
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.
|
signal |
This signal is emitted when a frame has been actually presented on the screen. timestamp indicates the time when it took place.
|
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.
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.
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.
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.
void KWin::RenderLoop::prepareNewFrame | ( | ) |
This function must be called before the Compositor sumbits the next frame.
Definition at line 170 of file renderloop.cpp.
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.
|
signal |
This signal is emitted when the refresh rate of this RenderLoop has changed.
void KWin::RenderLoop::scheduleRepaint | ( | Item * | item = nullptr | ) |
Schedules a compositing cycle at the next available moment.
Definition at line 199 of file renderloop.cpp.
void KWin::RenderLoop::setPresentationMode | ( | PresentationMode | mode | ) |
Definition at line 228 of file renderloop.cpp.
void KWin::RenderLoop::setPresentationSafetyMargin | ( | std::chrono::nanoseconds | safetyMargin | ) |
Definition at line 194 of file renderloop.cpp.
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.
void KWin::RenderLoop::uninhibit | ( | ) |
Uninhibits the render loop.
Definition at line 160 of file renderloop.cpp.
|
friend |
Definition at line 115 of file renderloop.h.