The QWaylandView class represents a view of a surface on an output. 更多...
头: | #include <QWaylandView> |
qmake: | QT += waylandcompositor |
Since: | Qt 5.8 |
继承: | QObject |
|
|
QWaylandView (QObject * renderObject = nullptr, QObject * parent = nullptr) | |
virtual | ~QWaylandView () |
virtual bool | advance () |
bool | allowDiscardFrontBuffer () const |
virtual void | bufferCommitted (const QWaylandBufferRef & buffer , const QRegion & damage ) |
virtual QWaylandBufferRef | currentBuffer () |
virtual QRegion | currentDamage () |
virtual void | discardCurrentBuffer () |
bool | isBufferLocked () const |
bool | isPrimary () const |
QWaylandOutput * | output () const |
void | setAllowDiscardFrontBuffer (bool discard ) |
void | setBufferLocked (bool locked ) |
void | setOutput (QWaylandOutput * output ) |
void | setPrimary () |
void | setSurface (QWaylandSurface * surface ) |
QWaylandSurface * | surface () const |
void | allowDiscardFrontBufferChanged () |
void | bufferLockedChanged () |
void | outputChanged () |
void | surfaceChanged () |
void | surfaceDestroyed () |
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.
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 primary view is no longer using it.
This can be used to avoid the situation where a secondary view that updates on a lower frequency will throttle the frame rate of the client application.
访问函数:
bool | allowDiscardFrontBuffer () const |
void | setAllowDiscardFrontBuffer (bool discard ) |
通知程序信号:
void | allowDiscardFrontBufferChanged () |
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
.
默认为
false
.
访问函数:
bool | isBufferLocked () const |
void | setBufferLocked (bool locked ) |
通知程序信号:
void | bufferLockedChanged () |
This property holds the output on which this view displays its surface.
访问函数:
QWaylandOutput * | output () const |
void | setOutput (QWaylandOutput * output ) |
通知程序信号:
void | outputChanged () |
This property holds the surface viewed by this QWaylandView .
访问函数:
QWaylandSurface * | surface () const |
void | setSurface (QWaylandSurface * surface ) |
通知程序信号:
void | surfaceChanged () |
构造 QWaylandView 采用给定 renderObject and parent .
[虚拟]
QWaylandView::
~QWaylandView
()
销毁 QWaylandView .
[虚拟]
bool
QWaylandView::
advance
()
Updates the current buffer and damage region to the latest version committed by the client. Returns true if new content was committed since the previous call to advance(). Otherwise returns false.
另请参阅 currentBuffer () 和 currentDamage ().
[虚拟]
void
QWaylandView::
bufferCommitted
(const
QWaylandBufferRef
&
buffer
, const
QRegion
&
damage
)
This function is called when a new buffer is committed to this view's surface. damage contains the region that is different from the current buffer, i.e. the region that needs to be updated. The new buffer will become current on the next call to advance ().
Subclasses that reimplement this function must call the base implementation.
[虚拟]
QWaylandBufferRef
QWaylandView::
currentBuffer
()
Returns a reference to this view's current buffer.
[虚拟]
QRegion
QWaylandView::
currentDamage
()
Returns the current damage region of this view.
[虚拟]
void
QWaylandView::
discardCurrentBuffer
()
Force the view to discard its current buffer, to allow it to be reused on the client side.
返回 true,若此 QWaylandView is the primary view for the QWaylandSurface
另请参阅 QWaylandSurface::primaryView .
Makes this QWaylandView the primary view for the surface.
另请参阅 isPrimary () 和 QWaylandSurface::primaryView .
[signal]
void
QWaylandView::
surfaceDestroyed
()