QWaylandView Class
Represents a view of a surface on an output. More...
Header: | #include <QWaylandView> |
qmake: | QT += waylandcompositor |
This class is under development and is subject to change.
Properties
|
|
Public Functions
QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr) | |
virtual | ~QWaylandView() |
virtual bool | advance() |
virtual void | attach(const QWaylandBufferRef &ref, const QRegion &damage) |
virtual QWaylandBufferRef | currentBuffer() |
virtual QRegion | currentDamage() |
virtual void | discardCurrentBuffer() |
bool | discardFrontBuffers() const |
bool | isBufferLocked() const |
QWaylandOutput * | output() const |
void | setBufferLock(bool locked) |
void | setDiscardFrontBuffers(bool discard) |
void | setOutput(QWaylandOutput *output) |
void | setSurface(QWaylandSurface *surface) |
QWaylandSurface * | surface() const |
Signals
void | bufferLockChanged() |
void | discardFrontBuffersChanged() |
void | outputChanged() |
void | surfaceChanged() |
void | surfaceDestroyed() |
Detailed Description
Represents a view of a surface on an output.
The WaylandView corresponds to the presentation of a surface on a specific output, managing the buffers that contain the contents to be rendered. You can have several views into the same surface.
Property Documentation
bufferLock : bool
This property holds whether the view's buffer is currently locked. When the buffer is locked, advance() will not advance to the next buffer, but will instead return false.
The default is false.
Access functions:
bool | isBufferLocked() const |
void | setBufferLock(bool locked) |
Notifier signal:
void | bufferLockChanged() |
discardFrontBuffers : bool
Access functions:
bool | discardFrontBuffers() const |
void | setDiscardFrontBuffers(bool discard) |
Notifier signal:
void | discardFrontBuffersChanged() |
output : QWaylandOutput *
This property holds the output on which this view displays its surface.
Access functions:
QWaylandOutput * | output() const |
void | setOutput(QWaylandOutput *output) |
Notifier signal:
void | outputChanged() |
renderObject : QObject * const
surface : QWaylandSurface *
This property holds the surface viewed by this QWaylandView.
Access functions:
QWaylandSurface * | surface() const |
void | setSurface(QWaylandSurface *surface) |
Notifier signal:
void | surfaceChanged() |
Member Function Documentation
QWaylandView::QWaylandView(QObject *renderObject = nullptr, QObject *parent = nullptr)
Constructs a QWaylandView with the given renderObject and parent.
[virtual]
QWaylandView::~QWaylandView()
Destroys the QWaylandView.
[virtual]
bool QWaylandView::advance()
Sets the next buffer and damage to current and returns true. If the buffer is locked or if no new buffer has been attached since the last call to advance(), the function returns false and does nothing.
If this view is set as its surface's throttling view, discardCurrentBuffer() will be called on all views of the same surface for which the discardFrontBuffers property is set to true and the current buffer is the same as the throttling view's current buffer.
This allows for a design where a primary view can make sure that views running on a lower frequency will release their front buffer references so that the buffer can be reused on the client side, avoiding the situation where the lower frequency views throttle the frame rate of the client application.
[virtual]
void QWaylandView::attach(const QWaylandBufferRef &ref, const QRegion &damage)
Attaches a new buffer ref and damage region to this QWaylandView. These will become current the next time advance() is called.
[virtual]
QWaylandBufferRef QWaylandView::currentBuffer()
Returns a reference to this view's current buffer.
[virtual]
QRegion QWaylandView::currentDamage()
Returns the current damage region of this view.
[virtual]
void QWaylandView::discardCurrentBuffer()
Force the view to discard its current buffer, to allow it to be reused on the client side.