qglpaintdevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/opengl/qglpaintdevice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QGLPaintDevice::QGLPaintDevice()-
5 : m_thisFBO(0)-
6{-
7}
executed 12 times by 3 tests: end of block
Executed by:
  • tst_qglbuffer - unknown status
  • tst_qglfunctions - unknown status
  • tst_qmdiarea - unknown status
12
8-
9QGLPaintDevice::~QGLPaintDevice()-
10{-
11}-
12-
13int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const-
14{-
15 switch(metric) {-
16 case
never executed: case PdmWidth:
PdmWidth:
never executed: case PdmWidth:
0
17 return
never executed: return size().width();
size().width();
never executed: return size().width();
0
18 case
never executed: case PdmHeight:
PdmHeight:
never executed: case PdmHeight:
0
19 return
never executed: return size().height();
size().height();
never executed: return size().height();
0
20 case
never executed: case PdmDepth:
PdmDepth:
never executed: case PdmDepth:
{
0
21 const QGLFormat f = format();-
22 return
never executed: return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
never executed: return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
0
23 }-
24 case
never executed: case PdmDevicePixelRatio:
PdmDevicePixelRatio:
never executed: case PdmDevicePixelRatio:
0
25 return
never executed: return 1;
1;
never executed: return 1;
0
26 case
never executed: case PdmDevicePixelRatioScaled:
PdmDevicePixelRatioScaled:
never executed: case PdmDevicePixelRatioScaled:
0
27 return
never executed: return 1 * QPaintDevice::devicePixelRatioFScale();
1 * QPaintDevice::devicePixelRatioFScale();
never executed: return 1 * QPaintDevice::devicePixelRatioFScale();
0
28 default
never executed: default:
:
never executed: default:
0
29 QMessageLogger(__FILE__, 74, __PRETTY_FUNCTION__).warning("QGLPaintDevice::metric() - metric %d not known", metric);-
30 return
never executed: return 0;
0;
never executed: return 0;
0
31 }-
32}-
33-
34void QGLPaintDevice::beginPaint()-
35{-
36-
37 QGLContext *ctx = context();-
38 ctx->makeCurrent();-
39-
40 ctx->d_func()->refreshCurrentFbo();-
41 m_previousFBO = ctx->d_func()->current_fbo;-
42-
43 if (m_previousFBO != m_thisFBO
m_previousFBO != m_thisFBODescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
44 ctx->d_func()->setCurrentFbo(m_thisFBO);-
45 ctx->contextHandle()->functions()->glBindFramebuffer(0x8D40, m_thisFBO);-
46 }
never executed: end of block
0
47-
48-
49-
50-
51-
52 ctx->d_ptr->default_fbo = m_thisFBO;-
53}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
54-
55void QGLPaintDevice::ensureActiveTarget()-
56{-
57 QGLContext* ctx = context();-
58 if (ctx != QGLContext::currentContext()
ctx != QGLCont...rrentContext()Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-42
59 ctx->makeCurrent();
never executed: ctx->makeCurrent();
0
60-
61 ctx->d_func()->refreshCurrentFbo();-
62-
63 if (ctx->d_ptr->current_fbo != m_thisFBO
ctx->d_ptr->cu...o != m_thisFBODescription
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-42
64 ctx->d_func()->setCurrentFbo(m_thisFBO);-
65 ctx->contextHandle()->functions()->glBindFramebuffer(0x8D40, m_thisFBO);-
66 }
never executed: end of block
0
67-
68 ctx->d_ptr->default_fbo = m_thisFBO;-
69}
executed 42 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
42
70-
71void QGLPaintDevice::endPaint()-
72{-
73-
74 QGLContext *ctx = context();-
75-
76 ctx->d_func()->refreshCurrentFbo();-
77-
78 if (m_previousFBO != ctx->d_func()->current_fbo
m_previousFBO ...)->current_fboDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
79 ctx->d_func()->setCurrentFbo(m_previousFBO);-
80 ctx->contextHandle()->functions()->glBindFramebuffer(0x8D40, m_previousFBO);-
81 }
never executed: end of block
0
82-
83 ctx->d_ptr->default_fbo = 0;-
84}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
85-
86QGLFormat QGLPaintDevice::format() const-
87{-
88 return
never executed: return context()->format();
context()->format();
never executed: return context()->format();
0
89}-
90-
91bool QGLPaintDevice::alphaRequested() const-
92{-
93 return
never executed: return context()->d_func()->reqFormat.alpha();
context()->d_func()->reqFormat.alpha();
never executed: return context()->d_func()->reqFormat.alpha();
0
94}-
95-
96bool QGLPaintDevice::isFlipped() const-
97{-
98 return
executed 5 times by 1 test: return false;
Executed by:
  • tst_qmdiarea - unknown status
false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qmdiarea - unknown status
5
99}-
100-
101-
102-
103QGLWidgetGLPaintDevice::QGLWidgetGLPaintDevice()-
104{-
105}-
106-
107QPaintEngine* QGLWidgetGLPaintDevice::paintEngine() const-
108{-
109 return
never executed: return glWidget->paintEngine();
glWidget->paintEngine();
never executed: return glWidget->paintEngine();
0
110}-
111-
112void QGLWidgetGLPaintDevice::setWidget(QGLWidget* w)-
113{-
114 glWidget = w;-
115}
executed 12 times by 3 tests: end of block
Executed by:
  • tst_qglbuffer - unknown status
  • tst_qglfunctions - unknown status
  • tst_qmdiarea - unknown status
12
116-
117void QGLWidgetGLPaintDevice::beginPaint()-
118{-
119 QGLPaintDevice::beginPaint();-
120 QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();-
121 if (!glWidget->d_func()->disable_clear_on_painter_begin
!glWidget->d_f..._painter_beginDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& glWidget->autoFillBackground()
glWidget->autoFillBackground()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
122 if (glWidget->testAttribute(Qt::WA_TranslucentBackground)
glWidget->test...entBackground)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-3
123 funcs->glClearColor(0.0, 0.0, 0.0, 0.0);
never executed: funcs->glClearColor(0.0, 0.0, 0.0, 0.0);
0
124 else {-
125 const QColor &c = glWidget->palette().brush(glWidget->backgroundRole()).color();-
126 float alpha = c.alphaF();-
127 funcs->glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha);-
128 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
129 if (context()->d_func()->workaround_needsFullClearOnEveryFrame
context()->d_f...arOnEveryFrameDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-3
130 funcs->glClear(0x00004000 | 0x00000100 | 0x00000400);
never executed: funcs->glClear(0x00004000 | 0x00000100 | 0x00000400);
0
131 else-
132 funcs->glClear(0x00004000);
executed 3 times by 1 test: funcs->glClear(0x00004000);
Executed by:
  • tst_qmdiarea - unknown status
3
133 }-
134}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
135-
136void QGLWidgetGLPaintDevice::endPaint()-
137{-
138 if (glWidget->autoBufferSwap()
glWidget->autoBufferSwap()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-3
139 glWidget->swapBuffers();
executed 3 times by 1 test: glWidget->swapBuffers();
Executed by:
  • tst_qmdiarea - unknown status
3
140 QGLPaintDevice::endPaint();-
141}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
142-
143-
144QSize QGLWidgetGLPaintDevice::size() const-
145{-
146-
147-
148-
149-
150 return
executed 3 times by 1 test: return glWidget->size();
Executed by:
  • tst_qmdiarea - unknown status
glWidget->size();
executed 3 times by 1 test: return glWidget->size();
Executed by:
  • tst_qmdiarea - unknown status
3
151-
152}-
153-
154QGLContext* QGLWidgetGLPaintDevice::context() const-
155{-
156 return
executed 54 times by 1 test: return const_cast<QGLContext*>(glWidget->context());
Executed by:
  • tst_qmdiarea - unknown status
const_cast<QGLContext*>(glWidget->context());
executed 54 times by 1 test: return const_cast<QGLContext*>(glWidget->context());
Executed by:
  • tst_qmdiarea - unknown status
54
157}-
158-
159-
160QGLPaintDevice* QGLPaintDevice::getDevice(QPaintDevice* pd)-
161{-
162 QGLPaintDevice* glpd = 0;-
163-
164 switch(pd->devType()) {-
165 case
executed 3 times by 1 test: case QInternal::Widget:
Executed by:
  • tst_qmdiarea - unknown status
QInternal::Widget:
executed 3 times by 1 test: case QInternal::Widget:
Executed by:
  • tst_qmdiarea - unknown status
3
166-
167 ((!(qobject_cast<QGLWidget*>(static_cast<QWidget*>(pd)))) ? qt_assert("qobject_cast<QGLWidget*>(static_cast<QWidget*>(pd))",__FILE__,221) : qt_noop());-
168 glpd = &(static_cast<QGLWidget*>(pd)->d_func()->glDevice);-
169 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_qmdiarea - unknown status
3
170 case
never executed: case QInternal::Pbuffer:
QInternal::Pbuffer:
never executed: case QInternal::Pbuffer:
0
171 glpd = &(static_cast<QGLPixelBuffer*>(pd)->d_func()->glDevice);-
172 break;
never executed: break;
0
173 case
never executed: case QInternal::FramebufferObject:
QInternal::FramebufferObject:
never executed: case QInternal::FramebufferObject:
0
174 glpd = &(static_cast<QGLFramebufferObject*>(pd)->d_func()->glDevice);-
175 break;
never executed: break;
0
176 case
never executed: case QInternal::Pixmap:
QInternal::Pixmap:
never executed: case QInternal::Pixmap:
{
0
177 QMessageLogger(__FILE__, 231, __PRETTY_FUNCTION__).warning("Pixmap type not supported for GL rendering");-
178 break;
never executed: break;
0
179 }-
180 default
never executed: default:
:
never executed: default:
0
181 QMessageLogger(__FILE__, 235, __PRETTY_FUNCTION__).warning("QGLPaintDevice::getDevice() - Unknown device type %d", pd->devType());-
182 break;
never executed: break;
0
183 }-
184-
185 return
executed 3 times by 1 test: return glpd;
Executed by:
  • tst_qmdiarea - unknown status
glpd;
executed 3 times by 1 test: return glpd;
Executed by:
  • tst_qmdiarea - unknown status
3
186}-
187-
188-
Switch to Source codePreprocessed file

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