Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | class QGLCustomShaderStagePrivate | - |
5 | { | - |
6 | public: | - |
7 | QGLCustomShaderStagePrivate() : | - |
8 | m_manager(0) {} | 0 |
9 | | - |
10 | QPointer<QGLEngineShaderManager> m_manager; | - |
11 | QByteArray m_source; | - |
12 | }; | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | QGLCustomShaderStage::QGLCustomShaderStage() | - |
18 | : d_ptr(new QGLCustomShaderStagePrivate) | - |
19 | { | - |
20 | } | 0 |
21 | | - |
22 | QGLCustomShaderStage::~QGLCustomShaderStage() | - |
23 | { | - |
24 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
25 | if (d->m_manager) { never evaluated: d->m_manager | 0 |
26 | d->m_manager->removeCustomStage(); | - |
27 | d->m_manager->sharedShaders->cleanupCustomStage(this); | - |
28 | } | 0 |
29 | } | 0 |
30 | | - |
31 | void QGLCustomShaderStage::setUniformsDirty() | - |
32 | { | - |
33 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
34 | if (d->m_manager) never evaluated: d->m_manager | 0 |
35 | d->m_manager->setDirty(); never executed: d->m_manager->setDirty(); | 0 |
36 | } | 0 |
37 | | - |
38 | bool QGLCustomShaderStage::setOnPainter(QPainter* p) | - |
39 | { | - |
40 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
41 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2) { never evaluated: p->paintEngine()->type() != QPaintEngine::OpenGL2 | 0 |
42 | QMessageLogger("gl2paintengineex/qglcustomshaderstage.cpp", 87, __PRETTY_FUNCTION__).warning("QGLCustomShaderStage::setOnPainter() - paint engine not OpenGL2"); | - |
43 | return false; never executed: return false; | 0 |
44 | } | - |
45 | if (d->m_manager) never evaluated: d->m_manager | 0 |
46 | QMessageLogger("gl2paintengineex/qglcustomshaderstage.cpp", 91, __PRETTY_FUNCTION__).warning("Custom shader is already set on a painter"); never executed: QMessageLogger("gl2paintengineex/qglcustomshaderstage.cpp", 91, __PRETTY_FUNCTION__).warning("Custom shader is already set on a painter"); | 0 |
47 | | - |
48 | QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx*>(p->paintEngine()); | - |
49 | d->m_manager = QGL2PaintEngineExPrivate::shaderManagerForEngine(engine); | - |
50 | qt_noop(); | - |
51 | | - |
52 | d->m_manager->setCustomStage(this); | - |
53 | return true; never executed: return true; | 0 |
54 | } | - |
55 | | - |
56 | void QGLCustomShaderStage::removeFromPainter(QPainter* p) | - |
57 | { | - |
58 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
59 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2) never evaluated: p->paintEngine()->type() != QPaintEngine::OpenGL2 | 0 |
60 | return; | 0 |
61 | | - |
62 | QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx*>(p->paintEngine()); | - |
63 | d->m_manager = QGL2PaintEngineExPrivate::shaderManagerForEngine(engine); | - |
64 | qt_noop(); | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | d->m_manager->setCustomStage(0); | - |
70 | d->m_manager = 0; | - |
71 | } | 0 |
72 | | - |
73 | QByteArray QGLCustomShaderStage::source() const | - |
74 | { | - |
75 | const QGLCustomShaderStagePrivate * const d = d_func(); | - |
76 | return d->m_source; never executed: return d->m_source; | 0 |
77 | } | - |
78 | | - |
79 | | - |
80 | | - |
81 | void QGLCustomShaderStage::setInactive() | - |
82 | { | - |
83 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
84 | d->m_manager = 0; | - |
85 | } | 0 |
86 | | - |
87 | void QGLCustomShaderStage::setSource(const QByteArray& s) | - |
88 | { | - |
89 | QGLCustomShaderStagePrivate * const d = d_func(); | - |
90 | d->m_source = s; | - |
91 | } | 0 |
92 | | - |
93 | | - |
94 | | - |
| | |