OpenCoverage

qsgrenderer_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QSGRENDERER_P_H-
41#define QSGRENDERER_P_H-
42-
43//-
44// W A R N I N G-
45// --------------
46//-
47// This file is not part of the Qt API. It exists purely as an-
48// implementation detail. This header file may change from version to-
49// version without notice, or even be removed.-
50//-
51// We mean it.-
52//-
53-
54#include "qsgabstractrenderer.h"-
55#include "qsgabstractrenderer_p.h"-
56#include "qsgnode.h"-
57#include "qsgmaterial.h"-
58-
59#include <QtQuick/private/qsgcontext_p.h>-
60-
61QT_BEGIN_NAMESPACE-
62-
63class QSGBindable;-
64class QSGNodeUpdater;-
65-
66Q_QUICK_PRIVATE_EXPORT bool qsg_test_and_clear_fatal_render_error();-
67Q_QUICK_PRIVATE_EXPORT void qsg_set_fatal_renderer_error();-
68-
69class Q_QUICK_PRIVATE_EXPORT QSGRenderer : public QSGAbstractRenderer-
70{-
71public:-
72-
73 QSGRenderer(QSGRenderContext *context);-
74 virtual ~QSGRenderer();-
75-
76 // Accessed by QSGMaterialShader::RenderState.-
77 QMatrix4x4 currentProjectionMatrix() const { return m_current_projection_matrix; }
never executed: return m_current_projection_matrix;
0
78 QMatrix4x4 currentModelViewMatrix() const { return m_current_model_view_matrix; }
never executed: return m_current_model_view_matrix;
0
79 QMatrix4x4 currentCombinedMatrix() const { return m_current_projection_matrix * m_current_model_view_matrix; }
executed 150174 times by 70 tests: return m_current_projection_matrix * m_current_model_view_matrix;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • ...
150174
80 qreal currentOpacity() const { return m_current_opacity; }
executed 59094 times by 67 tests: return m_current_opacity;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • tst_qquickimage
  • tst_qquickimageparticle
  • ...
59094
81 qreal determinant() const { return m_current_determinant; }
executed 34190 times by 24 tests: return m_current_determinant;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
82-
83 void setDevicePixelRatio(qreal ratio) { m_device_pixel_ratio = ratio; }
executed 50708 times by 76 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • ...
50708
84 qreal devicePixelRatio() const { return m_device_pixel_ratio; }
executed 34190 times by 24 tests: return m_device_pixel_ratio;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
85 QSGRenderContext *context() const { return m_context; }
executed 84802 times by 34 tests: return m_context;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickanimatedimage
  • tst_qquickborderimage
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquickitemlayer
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpainteditem
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • ...
84802
86-
87 bool isMirrored() const;-
88 void renderScene(const QSGBindable &bindable);-
89 void renderScene(uint fboId = 0) override;-
90 void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override;-
91-
92 QSGNodeUpdater *nodeUpdater() const;-
93 void setNodeUpdater(QSGNodeUpdater *updater);-
94 inline QSGMaterialShader::RenderState state(QSGMaterialShader::RenderState::DirtyStates dirty) const;-
95 virtual void setCustomRenderMode(const QByteArray &) { }-
96 virtual void releaseCachedResources() { }-
97-
98 void clearChangedFlag() { m_changed_emitted = false; }
never executed: end of block
0
99-
100protected:-
101 virtual void render() = 0;-
102-
103 const QSGBindable *bindable() const { return m_bindable; }
executed 50770 times by 75 tests: return m_bindable;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • ...
50770
104-
105 virtual void preprocess();-
106-
107 void addNodesToPreprocess(QSGNode *node);-
108 void removeNodesToPreprocess(QSGNode *node);-
109-
110 QMatrix4x4 m_current_projection_matrix;-
111 QMatrix4x4 m_current_model_view_matrix;-
112 qreal m_current_opacity;-
113 qreal m_current_determinant;-
114 qreal m_device_pixel_ratio;-
115-
116 QSGRenderContext *m_context;-
117-
118private:-
119 QSGNodeUpdater *m_node_updater;-
120-
121 QSet<QSGNode *> m_nodes_to_preprocess;-
122 QSet<QSGNode *> m_nodes_dont_preprocess;-
123-
124 const QSGBindable *m_bindable;-
125-
126 uint m_changed_emitted : 1;-
127 uint m_is_rendering : 1;-
128 uint m_is_preprocessing : 1;-
129};-
130-
131class Q_QUICK_PRIVATE_EXPORT QSGBindable-
132{-
133public:-
134 virtual ~QSGBindable() { }-
135 virtual void bind() const = 0;-
136 virtual void clear(QSGAbstractRenderer::ClearMode mode) const;-
137 virtual void reactivate() const;-
138};-
139#if QT_CONFIG(opengl)-
140class QSGBindableFboId : public QSGBindable-
141{-
142public:-
143 QSGBindableFboId(GLuint);-
144 void bind() const override;-
145private:-
146 GLuint m_id;-
147};-
148#endif-
149-
150-
151QSGMaterialShader::RenderState QSGRenderer::state(QSGMaterialShader::RenderState::DirtyStates dirty) const-
152{-
153 QSGMaterialShader::RenderState s;-
154 s.m_dirty = dirty;-
155 s.m_data = this;-
156 return s;
executed 116002 times by 70 tests: return s;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • tst_qquickgroupgoal
  • ...
116002
157}-
158-
159-
160class Q_QUICK_PRIVATE_EXPORT QSGNodeDumper : public QSGNodeVisitor {-
161-
162public:-
163 static void dump(QSGNode *n);-
164-
165 QSGNodeDumper() {}-
166 void visitNode(QSGNode *n) override;-
167 void visitChildren(QSGNode *n) override;-
168-
169private:-
170 int m_indent = 0;-
171};-
172-
173-
174-
175QT_END_NAMESPACE-
176-
177#endif-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0