Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSGRenderNode::RenderState Struct Referenceabstract

#include <qsgrendernode.h>

+ Inheritance diagram for QSGRenderNode::RenderState:
+ Collaboration diagram for QSGRenderNode::RenderState:

Public Member Functions

virtual ~RenderState ()
 
virtual const QMatrix4x4projectionMatrix () const =0
 
virtual QRect scissorRect () const =0
 
virtual bool scissorEnabled () const =0
 
virtual int stencilValue () const =0
 
virtual bool stencilEnabled () const =0
 
virtual const QRegionclipRegion () const =0
 
virtual voidget (const char *state) const
 

Detailed Description

Definition at line 38 of file qsgrendernode.h.

Constructor & Destructor Documentation

◆ ~RenderState()

QSGRenderNode::RenderState::~RenderState ( )
virtual

Definition at line 443 of file qsgrendernode.cpp.

Member Function Documentation

◆ clipRegion()

const QRegion * QSGRenderNode::RenderState::clipRegion ( ) const
pure virtual
Returns
the current clip region or null for backends where clipping is implemented via stencil or scissoring.

The software backend uses no projection, scissor or stencil, meaning most of the render state is not in use. However, the clip region that can be set on the QPainter still has to be communicated since reconstructing this manually in render() is not reasonable. It can therefore be queried via this function. The region is in world coordinates and can be passed to QPainter::setClipRegion() with Qt::ReplaceClip. This must be done before calling QPainter::setTransform() since the clip region is already mapped to the transform provided in QSGRenderNode::matrix().

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.

◆ get()

void * QSGRenderNode::RenderState::get ( const char * state) const
virtual
Returns
pointer to a state value.

Reserved for future use.

Definition at line 511 of file qsgrendernode.cpp.

References Q_UNUSED, and state.

◆ projectionMatrix()

const QMatrix4x4 * QSGRenderNode::RenderState::projectionMatrix ( ) const
pure virtual
Returns
pointer to the current projection matrix.

The model-view matrix can be retrieved with QSGRenderNode::matrix(). Typically {projection * modelview} is the matrix that is then used in the vertex shader to transform the vertices.

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.

◆ scissorEnabled()

const QMatrix4x4 * QSGRenderNode::RenderState::scissorEnabled ( ) const
pure virtual
Returns
the current state of scissoring.
Note
Only relevant for graphics APIs that have a dedicated on/off state of scissoring.

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.

◆ scissorRect()

const QMatrix4x4 * QSGRenderNode::RenderState::scissorRect ( ) const
pure virtual
Returns
the current scissor rectangle when clipping is active. x and y are the bottom left coordinates.

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.

◆ stencilEnabled()

const QMatrix4x4 * QSGRenderNode::RenderState::stencilEnabled ( ) const
pure virtual
Returns
the current state of stencil testing.
Note
With graphics APIs where stencil testing is enabled in pipeline state objects, instead of individual state-setting commands, it is up to the implementation of render() to enable stencil testing with operations KEEP, comparison function EQUAL, and a read and write mask of 0xFF.

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.

◆ stencilValue()

const QMatrix4x4 * QSGRenderNode::RenderState::stencilValue ( ) const
pure virtual
Returns
the current stencil reference value when clipping is active.

Implemented in RenderNodeState, and QSGBatchRenderer::RenderNodeState.


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