QSGRenderer Class

The renderer class is the abstract baseclass used for rendering the QML scene graph. More...

Header: #include <QSGRenderer>
Inherits: QSGAbstractRenderer

Public Functions

QSGNodeUpdater *nodeUpdater() const
void setNodeUpdater(QSGNodeUpdater *updater)

Reimplemented Public Functions

virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override

Detailed Description

The renderer is not tied to any particular surface. It expects a context to be current and will render into that surface according to how the device rect, viewport rect and projection transformation are set up.

Rendering is a sequence of steps initiated by calling renderScene(). This will effectively draw the scene graph starting at the root node. The QSGNode::preprocess() function will be called for all the nodes in the graph, followed by an update pass which updates all matrices, opacity, clip states and similar in the graph. Because the update pass is called after preprocess, it is safe to modify the graph during preprocess. To run a custom update pass over the graph, install a custom QSGNodeUpdater using setNodeUpdater(). Once all the graphs dirty states are updated, the virtual render() function is called.

The render() function is implemented by QSGRenderer subclasses to render the graph in the most optimal way for a given hardware.

The renderer can make use of stencil, depth and color buffers in addition to the scissor rect.

\internal

Member Function Documentation

[override virtual] void QSGRenderer::nodeChanged(QSGNode *node, QSGNode::DirtyState state)

Updates internal data structures and emits the sceneGraphChanged() signal.

If flags contains the QSGNode::DirtyNodeRemoved flag, the node might be in the process of being destroyed. It is then not safe to downcast the node pointer.

QSGNodeUpdater *QSGRenderer::nodeUpdater() const

Returns the node updater that this renderer uses to update states in the scene graph.

If no updater is specified a default one is constructed.

See also setNodeUpdater().

void QSGRenderer::setNodeUpdater(QSGNodeUpdater *updater)

Sets the node updater that this renderer uses to update states in the scene graph.

This will delete and override any existing node updater

See also nodeUpdater().