6#include <private/qquickprofiler_p.h>
7#include <qtquick_tracepoints_p.h>
9#include <QtCore/QElapsedTimer>
30 return ok ?
value : defaultValue;
62 : m_current_opacity(1)
63 , m_current_determinant(1)
64 , m_device_pixel_ratio(1)
66 , m_current_uniform_data(
nullptr)
67 , m_current_resource_update_batch(
nullptr)
70 , m_changed_emitted(
false)
71 , m_is_rendering(
false)
72 , m_is_preprocessing(
false)
82 delete m_node_updater;
96 return m_node_updater;
109 delete m_node_updater;
110 m_node_updater = updater;
126 m_is_rendering =
true;
128 bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled();
138 QQuickProfiler::SceneGraphRendererBinding);
150 QQuickProfiler::SceneGraphRendererRender);
152 m_is_rendering =
false;
153 m_changed_emitted =
false;
156 "time in renderer: total=%dms, preprocess=%d, updates=%d, rendering=%d",
157 int(renderTime / 1000000),
169 m_is_rendering =
true;
182 m_is_rendering =
false;
183 m_changed_emitted =
false;
202 m_nodes_to_preprocess.
insert(node);
204 m_nodes_to_preprocess.
remove(node);
207 if (!m_changed_emitted && !m_is_rendering) {
209 m_changed_emitted =
true;
218 m_is_preprocessing =
true;
226 QSet<QSGNode *>
items = m_nodes_to_preprocess;
243 bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled();
248 QQuickProfiler::SceneGraphRendererPreprocess);
257 QQuickProfiler::SceneGraphRendererUpdate);
259 m_is_preprocessing =
false;
260 m_nodes_dont_preprocess.
clear();
270 m_nodes_to_preprocess.
insert(node);
278 m_nodes_to_preprocess.
remove(node);
281 if (m_is_preprocessing)
282 m_nodes_dont_preprocess.
insert(node);
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
QSGRootNode * rootNode() const
Returns the root of the QSGNode scene.
QMatrix4x4 projectionMatrix(int index) const
Returns the projection matrix.
void sceneGraphChanged()
This signal is emitted on the first modification of a node in the tree after the last scene render.
void setRootNode(QSGRootNode *node)
Sets the node as the root of the QSGNode scene that you want to render.
The QSGNodeDumper class provides a way of dumping a scene grahp to the console.
void visitNode(QSGNode *n) override
static void dump(QSGNode *n)
void visitChildren(QSGNode *n) override
virtual bool isNodeBlocked(QSGNode *n, QSGNode *root) const
Returns true if node is has something that blocks it in the chain from node to root doing a full stat...
virtual void updateStates(QSGNode *n)
virtual void visitChildren(QSGNode *n)
virtual void visitNode(QSGNode *n)
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Flags flags() const
Returns the set of flags for this node.
QSGNode * firstChild() const
Returns the first child of this node.
virtual void preprocess()
Do necessary preprocessing before the frame.
The renderer class is the abstract baseclass used for rendering the QML scene graph.
virtual void preprocess()
void renderSceneInline() override
void removeNodesToPreprocess(QSGNode *node)
QSGRenderer(QSGRenderContext *context)
void setNodeUpdater(QSGNodeUpdater *updater)
Sets the node updater that this renderer uses to update states in the scene graph.
QVarLengthArray< QMatrix4x4, 1 > m_current_projection_matrix_native_ndc
void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override
Updates internal data structures and emits the sceneGraphChanged() signal.
virtual void renderInline()
void addNodesToPreprocess(QSGNode *node)
QSGRenderContext * m_context
void renderScene() override
Renders the scene.
void prepareSceneInline() override
QVarLengthArray< QMatrix4x4, 1 > m_current_projection_matrix
virtual void prepareInline()
QSGNodeUpdater * nodeUpdater() const
Returns the node updater that this renderer uses to update states in the scene graph.
The QSGRootNode is the toplevel root of any scene graph.
bool remove(const T &value)
bool contains(const T &value) const
iterator insert(const T &value)
void resize(qsizetype sz)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qCDebug(category,...)
#define Q_QUICK_SG_PROFILE_END(Type, position)
#define Q_QUICK_SG_PROFILE_RECORD(Type, position)
#define Q_QUICK_SG_PROFILE_START(Type)
int qt_sg_envInt(const char *name, int defaultValue)
static QT_BEGIN_NAMESPACE QElapsedTimer frameTimer
static qint64 preprocessTime
static qint64 updatePassTime
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define Q_TRACE_SCOPE(x,...)
#define Q_TRACE_POINT(provider, tracepoint,...)