6#include <private/qquickprofiler_p.h>
7#include <qtquick_tracepoints_p.h>
9#include <QtCore/QElapsedTimer>
34 return ok ?
value : defaultValue;
66 : m_current_opacity(1)
67 , m_current_determinant(1)
68 , m_device_pixel_ratio(1)
70 , m_current_uniform_data(
nullptr)
71 , m_current_resource_update_batch(
nullptr)
74 , m_changed_emitted(
false)
75 , m_is_rendering(
false)
76 , m_is_preprocessing(
false)
84 delete m_node_updater;
98 return m_node_updater;
111 delete m_node_updater;
112 m_node_updater = updater;
128 m_is_rendering =
true;
130 bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled();
140 QQuickProfiler::SceneGraphRendererBinding);
152 QQuickProfiler::SceneGraphRendererRender);
154 m_is_rendering =
false;
155 m_changed_emitted =
false;
158 "time in renderer: total=%dms, preprocess=%d, updates=%d, rendering=%d",
159 int(renderTime / 1000000),
171 m_is_rendering =
true;
184 m_is_rendering =
false;
185 m_changed_emitted =
false;
204 m_nodes_to_preprocess.
insert(node);
206 m_nodes_to_preprocess.
remove(node);
209 if (!m_changed_emitted && !m_is_rendering) {
211 m_changed_emitted =
true;
220 m_is_preprocessing =
true;
245 bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled();
250 QQuickProfiler::SceneGraphRendererPreprocess);
259 QQuickProfiler::SceneGraphRendererUpdate);
261 m_is_preprocessing =
false;
262 m_nodes_dont_preprocess.
clear();
272 m_nodes_to_preprocess.
insert(node);
280 m_nodes_to_preprocess.
remove(node);
283 if (m_is_preprocessing)
284 m_nodes_dont_preprocess.
insert(node);
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
void start() noexcept
Starts this timer.
qint64 nsecsElapsed() const noexcept
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
QMatrix4x4 projectionMatrix() const
Returns the projection matrix.
QSGRootNode * rootNode() const
Returns the root of the QSGNode scene.
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.
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
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)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
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 qEnvironmentVariableIsEmpty(const char *varName) noexcept
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,...)