gl2paintengineex/qglcustomshaderstage.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4class QGLCustomShaderStagePrivate -
5{ -
6public: -
7 QGLCustomShaderStagePrivate() : -
8 m_manager(0) {}
never executed: }
0
9 -
10 QPointer<QGLEngineShaderManager> m_manager; -
11 QByteArray m_source; -
12}; -
13 -
14 -
15 -
16 -
17QGLCustomShaderStage::QGLCustomShaderStage() -
18 : d_ptr(new QGLCustomShaderStagePrivate) -
19{ -
20}
never executed: }
0
21 -
22QGLCustomShaderStage::~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 }
never executed: }
0
29}
never executed: }
0
30 -
31void 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}
never executed: }
0
37 -
38bool 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 -
56void 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;
never executed: 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}
never executed: }
0
72 -
73QByteArray 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 -
81void QGLCustomShaderStage::setInactive() -
82{ -
83 QGLCustomShaderStagePrivate * const d = d_func(); -
84 d->m_manager = 0; -
85}
never executed: }
0
86 -
87void QGLCustomShaderStage::setSource(const QByteArray& s) -
88{ -
89 QGLCustomShaderStagePrivate * const d = d_func(); -
90 d->m_source = s; -
91}
never executed: }
0
92 -
93 -
94 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial