QWaylandView Class
The 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
The QWaylandView class represents a view of a surface on an output.
The QWaylandView 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 and returns false
.
The default is false
.
Access functions:
bool | isBufferLocked() const |
void | setBufferLock(bool locked) |
Notifier signal:
void | bufferLockChanged() |
discardFrontBuffers : bool
By default, the view locks the current buffer until advance() is called. Set this property to true
to allow Qt to release the buffer when the throttling view is no longer using it.
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 region 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 the surface's throttling view, discardCurrentBuffer() is 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.
To enable clients to reuse existing buffers, enable the primary view to ensure that views running on a lower frequency will release their front buffer references. This design approach should avoid 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 a damage region to this QWaylandView. These will become current on a subsequent call to the advance() method.
[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.