Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglcustomshaderstage.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | class QOpenGLCustomShaderStagePrivate | - | ||||||
5 | { | - | ||||||
6 | public: | - | ||||||
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 | - | |||||||
17 | QOpenGLCustomShaderStage::QOpenGLCustomShaderStage() | - | ||||||
18 | : d_ptr(new QOpenGLCustomShaderStagePrivate) | - | ||||||
19 | { | - | ||||||
20 | } never executed: end of block | 0 | ||||||
21 | - | |||||||
22 | QOpenGLCustomShaderStage::~QOpenGLCustomShaderStage() | - | ||||||
23 | { | - | ||||||
24 | QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setUniformsDirty() | - | ||||||
33 | { | - | ||||||
34 | QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setOnPainter(QPainter* p) | - | ||||||
40 | { | - | ||||||
41 | QOpenGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
42 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2
| 0 | ||||||
43 | QMessageLogger(__FILE__, 86, __PRETTY_FUNCTION__).warning("QOpenGLCustomShaderStage::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 | 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: true;return true; never executed: return true; | 0 | ||||||
55 | } | - | ||||||
56 | - | |||||||
57 | void QOpenGLCustomShaderStage::removeFromPainter(QPainter* p) | - | ||||||
58 | { | - | ||||||
59 | QOpenGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
60 | if (p->paintEngine()->type() != QPaintEngine::OpenGL2
| 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 | - | |||||||
74 | QByteArray QOpenGLCustomShaderStage::source() const | - | ||||||
75 | { | - | ||||||
76 | const QOpenGLCustomShaderStagePrivate * 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 QOpenGLCustomShaderStage::setInactive() | - | ||||||
83 | { | - | ||||||
84 | QOpenGLCustomShaderStagePrivate * const d = d_func(); | - | ||||||
85 | d->m_manager = 0; | - | ||||||
86 | } never executed: end of block | 0 | ||||||
87 | - | |||||||
88 | void 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 code | Preprocessed file |