qopenglcustomshaderstage.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglcustomshaderstage.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4class QOpenGLCustomShaderStagePrivate-
5{-
6public:-
7 QOpenGLCustomShaderStagePrivate() :-
8 m_manager(0) {}
never executed: end of block
0
9-
10 QPointer<QOpenGLEngineShaderManager> m_manager;-
11 QByteArray m_source;-
12};-
13-
14-
15-
16-
17QOpenGLCustomShaderStage::QOpenGLCustomShaderStage()-
18 : d_ptr(new QOpenGLCustomShaderStagePrivate)-
19{-
20}
never executed: end of block
0
21-
22QOpenGLCustomShaderStage::~QOpenGLCustomShaderStage()-
23{-
24 QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setUniformsDirty()-
33{-
34 QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setOnPainter(QPainter* p)-
40{-
41 QOpenGLCustomShaderStagePrivate * 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("QOpenGLCustomShaderStage::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 QOpenGL2PaintEngineEx *engine = static_cast<QOpenGL2PaintEngineEx*>(p->paintEngine());-
50 d->m_manager = QOpenGL2PaintEngineExPrivate::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 QOpenGLCustomShaderStage::removeFromPainter(QPainter* p)-
58{-
59 QOpenGLCustomShaderStagePrivate * 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 QOpenGL2PaintEngineEx *engine = static_cast<QOpenGL2PaintEngineEx*>(p->paintEngine());-
64 d->m_manager = QOpenGL2PaintEngineExPrivate::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 QOpenGLCustomShaderStage::source() const-
75{-
76 const QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setInactive()-
83{-
84 QOpenGLCustomShaderStagePrivate * const d = d_func();-
85 d->m_manager = 0;-
86}
never executed: end of block
0
87-
88void QOpenGLCustomShaderStage::setSource(const QByteArray& s)-
89{-
90 QOpenGLCustomShaderStagePrivate * 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