Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | - | |
3 | - | |
4 | - | |
5 | - | |
6 | class QSGMaterial; | - |
7 | class QSGMaterialShaderPrivate; | - |
8 | - | |
9 | namespace QSGBatchRenderer { | - |
10 | class ShaderManager; | - |
11 | } | - |
12 | - | |
13 | class __attribute__((visibility("default"))) QSGMaterialShader | - |
14 | { | - |
15 | public: | - |
16 | class __attribute__((visibility("default"))) RenderState { | - |
17 | public: | - |
18 | enum DirtyState | - |
19 | { | - |
20 | DirtyMatrix = 0x0001, | - |
21 | DirtyOpacity = 0x0002, | - |
22 | DirtyCachedMaterialData = 0x0004, | - |
23 | DirtyAll = 0xFFFF | - |
24 | }; | - |
25 | typedef QFlags<DirtyState> DirtyStates; | - |
26 | - | |
27 | inline DirtyStates dirtyStates() const { return never executed: m_dirty;return m_dirty; never executed: }return m_dirty; | 0 |
28 | - | |
29 | inline bool isMatrixDirty() const { return executed 120239 times by 71 tests: m_dirty & DirtyMatrix;return m_dirty & DirtyMatrix; Executed by:
executed 120239 times by 71 tests: }return m_dirty & DirtyMatrix; Executed by:
| 120239 |
30 | inline bool isOpacityDirty() const { return executed 81130 times by 67 tests: m_dirty & DirtyOpacity;return m_dirty & DirtyOpacity; Executed by:
executed 81130 times by 67 tests: }return m_dirty & DirtyOpacity; Executed by:
| 81130 |
31 | bool isCachedMaterialDataDirty() const { return never executed: m_dirty & DirtyCachedMaterialData;return m_dirty & DirtyCachedMaterialData; never executed: }return m_dirty & DirtyCachedMaterialData; | 0 |
32 | - | |
33 | float opacity() const; | - |
34 | QMatrix4x4 combinedMatrix() const; | - |
35 | QMatrix4x4 modelViewMatrix() const; | - |
36 | QMatrix4x4 projectionMatrix() const; | - |
37 | QRect viewportRect() const; | - |
38 | QRect deviceRect() const; | - |
39 | float determinant() const; | - |
40 | float devicePixelRatio() const; | - |
41 | - | |
42 | QOpenGLContext *context() const; | - |
43 | - | |
44 | private: | - |
45 | friend class QSGRenderer; | - |
46 | DirtyStates m_dirty; | - |
47 | const void *m_data; | - |
48 | }; | - |
49 | - | |
50 | QSGMaterialShader(); | - |
51 | virtual ~QSGMaterialShader(); | - |
52 | - | |
53 | virtual void activate(); | - |
54 | virtual void deactivate(); | - |
55 | - | |
56 | virtual void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial); | - |
57 | virtual char const *const *attributeNames() const = 0; | - |
58 | - | |
59 | inline QOpenGLShaderProgram *program() { return executed 356192 times by 71 tests: &m_program;return &m_program; Executed by:
executed 356192 times by 71 tests: }return &m_program; Executed by:
| 356192 |
60 | - | |
61 | protected: | - |
62 | inline QSGMaterialShaderPrivate* d_func() { return executed 11936 times by 71 tests: reinterpret_cast<QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 11936 times by 71 tests: } inline const QSGMaterialShaderPrivate* d_func() const { returnreturn reinterpret_cast<QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 8806 times by 71 tests: reinterpret_cast<const QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<const QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 8806 times by 71 tests: } friend class QSGMaterialShaderPrivate;return reinterpret_cast<const QSGMaterialShaderPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 8806-11936 |
63 | QSGMaterialShader(QSGMaterialShaderPrivate &dd); | - |
64 | - | |
65 | friend class QSGDefaultRenderContext; | - |
66 | friend class QSGBatchRenderer::ShaderManager; | - |
67 | - | |
68 | void setShaderSourceFile(QOpenGLShader::ShaderType type, const QString &sourceFile); | - |
69 | void setShaderSourceFiles(QOpenGLShader::ShaderType type, const QStringList &sourceFiles); | - |
70 | - | |
71 | virtual void compile(); | - |
72 | - | |
73 | virtual void initialize() { } | - |
74 | - | |
75 | virtual const char *vertexShader() const; | - |
76 | virtual const char *fragmentShader() const; | - |
77 | - | |
78 | private: | - |
79 | - | |
80 | QOpenGLShaderProgram m_program; | - |
81 | - | |
82 | QScopedPointer<QSGMaterialShaderPrivate> d_ptr; | - |
83 | }; | - |
84 | - | |
85 | struct QSGMaterialType { }; | - |
86 | - | |
87 | class __attribute__((visibility("default"))) QSGMaterial | - |
88 | { | - |
89 | public: | - |
90 | enum Flag { | - |
91 | Blending = 0x0001, | - |
92 | RequiresDeterminant = 0x0002, | - |
93 | RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant, | - |
94 | RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate, | - |
95 | - | |
96 | CustomCompileStep = 0x0010 | - |
97 | }; | - |
98 | typedef QFlags<Flag> Flags; | - |
99 | - | |
100 | QSGMaterial(); | - |
101 | virtual ~QSGMaterial(); | - |
102 | - | |
103 | virtual QSGMaterialType *type() const = 0; | - |
104 | virtual QSGMaterialShader *createShader() const = 0; | - |
105 | virtual int compare(const QSGMaterial *other) const; | - |
106 | - | |
107 | QSGMaterial::Flags flags() const { return executed 2006535 times by 72 tests: m_flags;return m_flags; Executed by:
executed 2006535 times by 72 tests: }return m_flags; Executed by:
| 2006535 |
108 | void setFlag(Flags flags, bool on = true); | - |
109 | - | |
110 | private: | - |
111 | Flags m_flags; | - |
112 | void *m_reserved; | - |
113 | QSGMaterial(const QSGMaterial &) = delete; QSGMaterial &operator=(const QSGMaterial &) = delete; | - |
114 | }; | - |
115 | - | |
116 | constexpr inline QFlags<QSGMaterial::Flags::enum_type> operator|(QSGMaterial::Flags::enum_type f1, QSGMaterial::Flags::enum_type f2) noexcept { return QFlags<QSGMaterial::Flags::enum_type>(f1) | f2; } constexpr inline QFlags<QSGMaterial::Flags::enum_type> operator|(QSGMaterial::Flags::enum_type f1, QFlags<QSGMaterial::Flags::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QSGMaterial::Flags::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - |
117 | constexpr inline QFlags<QSGMaterialShader::RenderState::DirtyStates::enum_type> operator|(QSGMaterialShader::RenderState::DirtyStates::enum_type f1, QSGMaterialShader::RenderState::DirtyStates::enum_type f2) noexcept { return QFlags<QSGMaterialShader::RenderState::DirtyStates::enum_type>(f1) | f2; } constexpr inline QFlags<QSGMaterialShader::RenderState::DirtyStates::enum_type> operator|(QSGMaterialShader::RenderState::DirtyStates::enum_type f1, QFlags<QSGMaterialShader::RenderState::DirtyStates::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QSGMaterialShader::RenderState::DirtyStates::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - |
118 | - | |
119 | - | |
Switch to Source code | Preprocessed file |