qglcustomshaderstage.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4class QGLCustomShaderStagePrivate-
5{-
6public:-
7 QGLCustomShaderStagePrivate() :-
8 m_manager(0) {}
never executed: end of block
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: end of block
0
21-
22QGLCustomShaderStage::~QGLCustomShaderStage()-
23{-
24 QGLCustomShaderStagePrivate * const d = d_func();-
25 if (d->m_manager
d->m_managerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
26 d->m_manager->removeCustomStage();-
27 d->m_manager->sharedShaders->cleanupCustomStage(this);-
28 }
never executed: end of block
0
29 delete d_ptr;-
30}
never executed: end of block
0
31-
32void QGLCustomShaderStage::setUniformsDirty()-
33{-
34 QGLCustomShaderStagePrivate * const d = d_func();-
35 if (d->m_manager
d->m_managerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
36 d->m_manager->setDirty();
never executed: d->m_manager->setDirty();
0
37}
never executed: end of block
0
38-
39bool QGLCustomShaderStage::setOnPainter(QPainter* p)-
40{-
41 QGLCustomShaderStagePrivate * const d = d_func();-
42 if (p->paintEngine()->type() != QPaintEngine::OpenGL2
p->paintEngine...ngine::OpenGL2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
43 QMessageLogger(__FILE__, 86, __PRETTY_FUNCTION__).warning("QGLCustomShaderStage::setOnPainter() - paint engine not OpenGL2");-
44 return
never executed: return false;
false;
never executed: return false;
0
45 }-
46 if (d->m_manager
d->m_managerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
47 QMessageLogger(__FILE__, 90, __PRETTY_FUNCTION__).warning("Custom shader is already set on a painter");
never executed: QMessageLogger(__FILE__, 90, __PRETTY_FUNCTION__).warning("Custom shader is already set on a painter");
0
48-
49 QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx*>(p->paintEngine());-
50 d->m_manager = QGL2PaintEngineExPrivate::shaderManagerForEngine(engine);-
51 ((!(d->m_manager)) ? qt_assert("d->m_manager",__FILE__,94) : qt_noop());-
52-
53 d->m_manager->setCustomStage(this);-
54 return
never executed: return true;
true;
never executed: return true;
0
55}-
56-
57void QGLCustomShaderStage::removeFromPainter(QPainter* p)-
58{-
59 QGLCustomShaderStagePrivate * const d = d_func();-
60 if (p->paintEngine()->type() != QPaintEngine::OpenGL2
p->paintEngine...ngine::OpenGL2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
61 return;
never executed: return;
0
62-
63 QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx*>(p->paintEngine());-
64 d->m_manager = QGL2PaintEngineExPrivate::shaderManagerForEngine(engine);-
65 ((!(d->m_manager)) ? qt_assert("d->m_manager",__FILE__,108) : qt_noop());-
66-
67-
68-
69-
70 d->m_manager->setCustomStage(0);-
71 d->m_manager = 0;-
72}
never executed: end of block
0
73-
74QByteArray QGLCustomShaderStage::source() const-
75{-
76 const QGLCustomShaderStagePrivate * const d = d_func();-
77 return
never executed: return d->m_source;
d->m_source;
never executed: return d->m_source;
0
78}-
79-
80-
81-
82void QGLCustomShaderStage::setInactive()-
83{-
84 QGLCustomShaderStagePrivate * const d = d_func();-
85 d->m_manager = 0;-
86}
never executed: end of block
0
87-
88void QGLCustomShaderStage::setSource(const QByteArray& s)-
89{-
90 QGLCustomShaderStagePrivate * const d = d_func();-
91 d->m_source = s;-
92}
never executed: end of block
0
93-
94-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9