Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | class QGLCustomShaderStagePrivate | - | ||||||
5 | { | - | ||||||
6 | public: | - | ||||||
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 | - | |||||||
17 | QGLCustomShaderStage::QGLCustomShaderStage() | - | ||||||
18 | : d_ptr(new QGLCustomShaderStagePrivate) | - | ||||||
19 | { | - | ||||||
20 | } never executed: end of block | 0 | ||||||
21 | - | |||||||
22 | QGLCustomShaderStage::~QGLCustomShaderStage() | - | ||||||
23 | { | - | ||||||
24 | QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
25 | if (d->m_manager
| 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 | - | |||||||
32 | void QGLCustomShaderStage::setUniformsDirty() | - | ||||||
33 | { | - | ||||||
34 | QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
35 | if (d->m_manager
| 0 | ||||||
36 | d->m_manager->setDirty(); never executed: d->m_manager->setDirty(); | 0 | ||||||
37 | } never executed: end of block | 0 | ||||||
38 | - | |||||||
39 | bool QGLCustomShaderStage::setOnPainter(QPainter* p) | - | ||||||
40 | { | - | ||||||
41 | QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
42 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2
| 0 | ||||||
43 | QMessageLogger(__FILE__, 86, __PRETTY_FUNCTION__).warning("QGLCustomShaderStage::setOnPainter() - paint engine not OpenGL2"); | - | ||||||
44 | return never executed: false;return false; never executed: return false; | 0 | ||||||
45 | } | - | ||||||
46 | if (d->m_manager
| 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: true;return true; never executed: return true; | 0 | ||||||
55 | } | - | ||||||
56 | - | |||||||
57 | void QGLCustomShaderStage::removeFromPainter(QPainter* p) | - | ||||||
58 | { | - | ||||||
59 | QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
60 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2
| 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 | - | |||||||
74 | QByteArray QGLCustomShaderStage::source() const | - | ||||||
75 | { | - | ||||||
76 | const QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
77 | return never executed: d->m_source;return d->m_source; never executed: return d->m_source; | 0 | ||||||
78 | } | - | ||||||
79 | - | |||||||
80 | - | |||||||
81 | - | |||||||
82 | void QGLCustomShaderStage::setInactive() | - | ||||||
83 | { | - | ||||||
84 | QGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
85 | d->m_manager = 0; | - | ||||||
86 | } never executed: end of block | 0 | ||||||
87 | - | |||||||
88 | void 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 code | Preprocessed file |