| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qopenglwindow.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | class QOpenGLWindowPaintDevice : public QOpenGLPaintDevice | - | ||||||||||||
| 4 | { | - | ||||||||||||
| 5 | public: | - | ||||||||||||
| 6 | QOpenGLWindowPaintDevice(QOpenGLWindow *window) : m_window(window) { } never executed: end of block | 0 | ||||||||||||
| 7 | void ensureActiveTarget() override; | - | ||||||||||||
| 8 | - | |||||||||||||
| 9 | QOpenGLWindow *m_window; | - | ||||||||||||
| 10 | }; | - | ||||||||||||
| 11 | - | |||||||||||||
| 12 | class QOpenGLWindowPrivate : public QPaintDeviceWindowPrivate | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | inline QOpenGLWindow* q_func() { return static_cast<QOpenGLWindow *>(q_ptr); } inline const QOpenGLWindow* q_func() const { return static_cast<const QOpenGLWindow *>(q_ptr); } friend class QOpenGLWindow; | - | ||||||||||||
| 15 | public: | - | ||||||||||||
| 16 | QOpenGLWindowPrivate(QOpenGLContext *shareContext, QOpenGLWindow::UpdateBehavior updateBehavior) | - | ||||||||||||
| 17 | : updateBehavior(updateBehavior) | - | ||||||||||||
| 18 | , hasFboBlit(false) | - | ||||||||||||
| 19 | , shareContext(shareContext) | - | ||||||||||||
| 20 | { | - | ||||||||||||
| 21 | if (!shareContext
| 0 | ||||||||||||
| 22 | this->shareContext = qt_gl_global_share_context(); never executed: this->shareContext = qt_gl_global_share_context(); | 0 | ||||||||||||
| 23 | } never executed: end of block | 0 | ||||||||||||
| 24 | - | |||||||||||||
| 25 | ~QOpenGLWindowPrivate(); | - | ||||||||||||
| 26 | - | |||||||||||||
| 27 | static QOpenGLWindowPrivate *get(QOpenGLWindow *w) { return never executed: w->d_func();return w->d_func();never executed: }return w->d_func(); | 0 | ||||||||||||
| 28 | - | |||||||||||||
| 29 | void bindFBO(); | - | ||||||||||||
| 30 | void initialize(); | - | ||||||||||||
| 31 | - | |||||||||||||
| 32 | void beginPaint(const QRegion ®ion) override; | - | ||||||||||||
| 33 | void endPaint() override; | - | ||||||||||||
| 34 | void flush(const QRegion ®ion) override; | - | ||||||||||||
| 35 | - | |||||||||||||
| 36 | QOpenGLWindow::UpdateBehavior updateBehavior; | - | ||||||||||||
| 37 | bool hasFboBlit; | - | ||||||||||||
| 38 | QScopedPointer<QOpenGLContext> context; | - | ||||||||||||
| 39 | QOpenGLContext *shareContext; | - | ||||||||||||
| 40 | QScopedPointer<QOpenGLFramebufferObject> fbo; | - | ||||||||||||
| 41 | QScopedPointer<QOpenGLWindowPaintDevice> paintDevice; | - | ||||||||||||
| 42 | QOpenGLTextureBlitter blitter; | - | ||||||||||||
| 43 | QColor backgroundColor; | - | ||||||||||||
| 44 | QScopedPointer<QOffscreenSurface> offscreenSurface; | - | ||||||||||||
| 45 | }; | - | ||||||||||||
| 46 | - | |||||||||||||
| 47 | QOpenGLWindowPrivate::~QOpenGLWindowPrivate() | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | QOpenGLWindow * const q = q_func(); | - | ||||||||||||
| 50 | if (q->isValid()
| 0 | ||||||||||||
| 51 | q->makeCurrent(); | - | ||||||||||||
| 52 | paintDevice.reset(0); | - | ||||||||||||
| 53 | fbo.reset(0); | - | ||||||||||||
| 54 | blitter.destroy(); | - | ||||||||||||
| 55 | q->doneCurrent(); | - | ||||||||||||
| 56 | } never executed: end of block | 0 | ||||||||||||
| 57 | } never executed: end of block | 0 | ||||||||||||
| 58 | - | |||||||||||||
| 59 | void QOpenGLWindowPrivate::initialize() | - | ||||||||||||
| 60 | { | - | ||||||||||||
| 61 | QOpenGLWindow * const q = q_func(); | - | ||||||||||||
| 62 | - | |||||||||||||
| 63 | if (context
| 0 | ||||||||||||
| 64 | return; never executed: return; | 0 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | context.reset(new QOpenGLContext); | - | ||||||||||||
| 67 | context->setShareContext(shareContext); | - | ||||||||||||
| 68 | context->setFormat(q->requestedFormat()); | - | ||||||||||||
| 69 | if (!context->create()
| 0 | ||||||||||||
| 70 | QMessageLogger(__FILE__, 223, __PRETTY_FUNCTION__).warning("QOpenGLWindow::beginPaint: Failed to create context"); never executed: QMessageLogger(__FILE__, 223, __PRETTY_FUNCTION__).warning("QOpenGLWindow::beginPaint: Failed to create context"); | 0 | ||||||||||||
| 71 | if (!context->makeCurrent(q)
| 0 | ||||||||||||
| 72 | QMessageLogger(__FILE__, 225, __PRETTY_FUNCTION__).warning("QOpenGLWindow::beginPaint: Failed to make context current"); never executed: QMessageLogger(__FILE__, 225, __PRETTY_FUNCTION__).warning("QOpenGLWindow::beginPaint: Failed to make context current"); | 0 | ||||||||||||
| 73 | - | |||||||||||||
| 74 | paintDevice.reset(new QOpenGLWindowPaintDevice(q)); | - | ||||||||||||
| 75 | if (updateBehavior == QOpenGLWindow::PartialUpdateBlit
| 0 | ||||||||||||
| 76 | hasFboBlit = QOpenGLFramebufferObject::hasOpenGLFramebufferBlit(); never executed: hasFboBlit = QOpenGLFramebufferObject::hasOpenGLFramebufferBlit(); | 0 | ||||||||||||
| 77 | - | |||||||||||||
| 78 | q->initializeGL(); | - | ||||||||||||
| 79 | } never executed: end of block | 0 | ||||||||||||
| 80 | - | |||||||||||||
| 81 | void QOpenGLWindowPrivate::beginPaint(const QRegion ®ion) | - | ||||||||||||
| 82 | { | - | ||||||||||||
| 83 | (void)region;; | - | ||||||||||||
| 84 | QOpenGLWindow * const q = q_func(); | - | ||||||||||||
| 85 | - | |||||||||||||
| 86 | initialize(); | - | ||||||||||||
| 87 | context->makeCurrent(q); | - | ||||||||||||
| 88 | - | |||||||||||||
| 89 | const int deviceWidth = q->width() * q->devicePixelRatio(); | - | ||||||||||||
| 90 | const int deviceHeight = q->height() * q->devicePixelRatio(); | - | ||||||||||||
| 91 | const QSize deviceSize(deviceWidth, deviceHeight); | - | ||||||||||||
| 92 | if (updateBehavior > QOpenGLWindow::NoPartialUpdate
| 0 | ||||||||||||
| 93 | if (!fbo
| 0 | ||||||||||||
| 94 | QOpenGLFramebufferObjectFormat fboFormat; | - | ||||||||||||
| 95 | fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); | - | ||||||||||||
| 96 | if (q->requestedFormat().samples() > 0
| 0 | ||||||||||||
| 97 | if (updateBehavior != QOpenGLWindow::PartialUpdateBlend
| 0 | ||||||||||||
| 98 | fboFormat.setSamples(q->requestedFormat().samples()); never executed: fboFormat.setSamples(q->requestedFormat().samples()); | 0 | ||||||||||||
| 99 | else | - | ||||||||||||
| 100 | QMessageLogger(__FILE__, 253, __PRETTY_FUNCTION__).warning("QOpenGLWindow: PartialUpdateBlend does not support multisampling"); never executed: QMessageLogger(__FILE__, 253, __PRETTY_FUNCTION__).warning("QOpenGLWindow: PartialUpdateBlend does not support multisampling"); | 0 | ||||||||||||
| 101 | } | - | ||||||||||||
| 102 | fbo.reset(new QOpenGLFramebufferObject(deviceSize, fboFormat)); | - | ||||||||||||
| 103 | markWindowAsDirty(); | - | ||||||||||||
| 104 | } never executed: end of block | 0 | ||||||||||||
| 105 | } never executed: else {end of block | 0 | ||||||||||||
| 106 | markWindowAsDirty(); | - | ||||||||||||
| 107 | } never executed: end of block | 0 | ||||||||||||
| 108 | - | |||||||||||||
| 109 | paintDevice->setSize(QSize(deviceWidth, deviceHeight)); | - | ||||||||||||
| 110 | paintDevice->setDevicePixelRatio(q->devicePixelRatio()); | - | ||||||||||||
| 111 | context->functions()->glViewport(0, 0, deviceWidth, deviceHeight); | - | ||||||||||||
| 112 | - | |||||||||||||
| 113 | context->functions()->glBindFramebuffer(0x8D40, context->defaultFramebufferObject()); | - | ||||||||||||
| 114 | - | |||||||||||||
| 115 | q->paintUnderGL(); | - | ||||||||||||
| 116 | - | |||||||||||||
| 117 | if (updateBehavior > QOpenGLWindow::NoPartialUpdate
| 0 | ||||||||||||
| 118 | fbo->bind(); never executed: fbo->bind(); | 0 | ||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||
| 120 | - | |||||||||||||
| 121 | void QOpenGLWindowPrivate::endPaint() | - | ||||||||||||
| 122 | { | - | ||||||||||||
| 123 | QOpenGLWindow * const q = q_func(); | - | ||||||||||||
| 124 | - | |||||||||||||
| 125 | if (updateBehavior > QOpenGLWindow::NoPartialUpdate
| 0 | ||||||||||||
| 126 | fbo->release(); never executed: fbo->release(); | 0 | ||||||||||||
| 127 | - | |||||||||||||
| 128 | context->functions()->glBindFramebuffer(0x8D40, context->defaultFramebufferObject()); | - | ||||||||||||
| 129 | - | |||||||||||||
| 130 | if (updateBehavior == QOpenGLWindow::PartialUpdateBlit
| 0 | ||||||||||||
| 131 | const int deviceWidth = q->width() * q->devicePixelRatio(); | - | ||||||||||||
| 132 | const int deviceHeight = q->height() * q->devicePixelRatio(); | - | ||||||||||||
| 133 | QOpenGLExtensions extensions(context.data()); | - | ||||||||||||
| 134 | extensions.glBindFramebuffer(0x8CA8, fbo->handle()); | - | ||||||||||||
| 135 | extensions.glBindFramebuffer(0x8CA9, context->defaultFramebufferObject()); | - | ||||||||||||
| 136 | extensions.glBlitFramebuffer(0, 0, deviceWidth, deviceHeight, | - | ||||||||||||
| 137 | 0, 0, deviceWidth, deviceHeight, | - | ||||||||||||
| 138 | 0x00004000, 0x2600); | - | ||||||||||||
| 139 | } never executed: else if (updateBehavior > QOpenGLWindow::NoPartialUpdateend of block
| 0 | ||||||||||||
| 140 | if (updateBehavior == QOpenGLWindow::PartialUpdateBlend
| 0 | ||||||||||||
| 141 | context->functions()->glEnable(0x0BE2); | - | ||||||||||||
| 142 | context->functions()->glBlendFunc(0x0302, 0x0303); | - | ||||||||||||
| 143 | } never executed: end of block | 0 | ||||||||||||
| 144 | if (!blitter.isCreated()
| 0 | ||||||||||||
| 145 | blitter.create(); never executed: blitter.create(); | 0 | ||||||||||||
| 146 | - | |||||||||||||
| 147 | QRect windowRect(QPoint(0, 0), fbo->size()); | - | ||||||||||||
| 148 | QMatrix4x4 target = QOpenGLTextureBlitter::targetTransform(windowRect, windowRect); | - | ||||||||||||
| 149 | blitter.bind(); | - | ||||||||||||
| 150 | blitter.blit(fbo->texture(), target, QOpenGLTextureBlitter::OriginBottomLeft); | - | ||||||||||||
| 151 | blitter.release(); | - | ||||||||||||
| 152 | - | |||||||||||||
| 153 | if (updateBehavior == QOpenGLWindow::PartialUpdateBlend
| 0 | ||||||||||||
| 154 | context->functions()->glDisable(0x0BE2); never executed: context->functions()->glDisable(0x0BE2); | 0 | ||||||||||||
| 155 | } never executed: end of block | 0 | ||||||||||||
| 156 | - | |||||||||||||
| 157 | q->paintOverGL(); | - | ||||||||||||
| 158 | } never executed: end of block | 0 | ||||||||||||
| 159 | - | |||||||||||||
| 160 | void QOpenGLWindowPrivate::bindFBO() | - | ||||||||||||
| 161 | { | - | ||||||||||||
| 162 | if (updateBehavior > QOpenGLWindow::NoPartialUpdate
| 0 | ||||||||||||
| 163 | fbo->bind(); never executed: fbo->bind(); | 0 | ||||||||||||
| 164 | else | - | ||||||||||||
| 165 | QOpenGLFramebufferObject::bindDefault(); never executed: QOpenGLFramebufferObject::bindDefault(); | 0 | ||||||||||||
| 166 | } | - | ||||||||||||
| 167 | - | |||||||||||||
| 168 | void QOpenGLWindowPrivate::flush(const QRegion ®ion) | - | ||||||||||||
| 169 | { | - | ||||||||||||
| 170 | (void)region;; | - | ||||||||||||
| 171 | QOpenGLWindow * const q = q_func(); | - | ||||||||||||
| 172 | context->swapBuffers(q); | - | ||||||||||||
| 173 | q->frameSwapped(); | - | ||||||||||||
| 174 | } never executed: end of block | 0 | ||||||||||||
| 175 | - | |||||||||||||
| 176 | void QOpenGLWindowPaintDevice::ensureActiveTarget() | - | ||||||||||||
| 177 | { | - | ||||||||||||
| 178 | QOpenGLWindowPrivate::get(m_window)->bindFBO(); | - | ||||||||||||
| 179 | } never executed: end of block | 0 | ||||||||||||
| 180 | - | |||||||||||||
| 181 | - | |||||||||||||
| 182 | - | |||||||||||||
| 183 | - | |||||||||||||
| 184 | - | |||||||||||||
| 185 | - | |||||||||||||
| 186 | QOpenGLWindow::QOpenGLWindow(QOpenGLWindow::UpdateBehavior updateBehavior, QWindow *parent) | - | ||||||||||||
| 187 | : QPaintDeviceWindow(*(new QOpenGLWindowPrivate(nullptr, updateBehavior)), parent) | - | ||||||||||||
| 188 | { | - | ||||||||||||
| 189 | setSurfaceType(QSurface::OpenGLSurface); | - | ||||||||||||
| 190 | } never executed: end of block | 0 | ||||||||||||
| 191 | - | |||||||||||||
| 192 | - | |||||||||||||
| 193 | - | |||||||||||||
| 194 | - | |||||||||||||
| 195 | - | |||||||||||||
| 196 | - | |||||||||||||
| 197 | QOpenGLWindow::QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior, QWindow *parent) | - | ||||||||||||
| 198 | : QPaintDeviceWindow(*(new QOpenGLWindowPrivate(shareContext, updateBehavior)), parent) | - | ||||||||||||
| 199 | { | - | ||||||||||||
| 200 | setSurfaceType(QSurface::OpenGLSurface); | - | ||||||||||||
| 201 | } never executed: end of block | 0 | ||||||||||||
| 202 | QOpenGLWindow::~QOpenGLWindow() | - | ||||||||||||
| 203 | { | - | ||||||||||||
| 204 | makeCurrent(); | - | ||||||||||||
| 205 | } never executed: end of block | 0 | ||||||||||||
| 206 | - | |||||||||||||
| 207 | - | |||||||||||||
| 208 | - | |||||||||||||
| 209 | - | |||||||||||||
| 210 | QOpenGLWindow::UpdateBehavior QOpenGLWindow::updateBehavior() const | - | ||||||||||||
| 211 | { | - | ||||||||||||
| 212 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 213 | return never executed: d->updateBehavior;return d->updateBehavior;never executed: return d->updateBehavior; | 0 | ||||||||||||
| 214 | } | - | ||||||||||||
| 215 | - | |||||||||||||
| 216 | - | |||||||||||||
| 217 | - | |||||||||||||
| 218 | - | |||||||||||||
| 219 | - | |||||||||||||
| 220 | - | |||||||||||||
| 221 | bool QOpenGLWindow::isValid() const | - | ||||||||||||
| 222 | { | - | ||||||||||||
| 223 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 224 | return never executed: d->contextreturn d->context && d->context->isValid();
never executed: return d->context && d->context->isValid(); | 0 | ||||||||||||
| 225 | } | - | ||||||||||||
| 226 | void QOpenGLWindow::makeCurrent() | - | ||||||||||||
| 227 | { | - | ||||||||||||
| 228 | QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 229 | - | |||||||||||||
| 230 | if (!isValid()
| 0 | ||||||||||||
| 231 | return; never executed: return; | 0 | ||||||||||||
| 232 | - | |||||||||||||
| 233 | - | |||||||||||||
| 234 | - | |||||||||||||
| 235 | if (handle()
| 0 | ||||||||||||
| 236 | d->context->makeCurrent(this); | - | ||||||||||||
| 237 | } never executed: else {end of block | 0 | ||||||||||||
| 238 | if (!d->offscreenSurface
| 0 | ||||||||||||
| 239 | d->offscreenSurface.reset(new QOffscreenSurface); | - | ||||||||||||
| 240 | d->offscreenSurface->setFormat(d->context->format()); | - | ||||||||||||
| 241 | d->offscreenSurface->create(); | - | ||||||||||||
| 242 | } never executed: end of block | 0 | ||||||||||||
| 243 | d->context->makeCurrent(d->offscreenSurface.data()); | - | ||||||||||||
| 244 | } never executed: end of block | 0 | ||||||||||||
| 245 | - | |||||||||||||
| 246 | d->bindFBO(); | - | ||||||||||||
| 247 | } never executed: end of block | 0 | ||||||||||||
| 248 | void QOpenGLWindow::doneCurrent() | - | ||||||||||||
| 249 | { | - | ||||||||||||
| 250 | QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 251 | - | |||||||||||||
| 252 | if (!isValid()
| 0 | ||||||||||||
| 253 | return; never executed: return; | 0 | ||||||||||||
| 254 | - | |||||||||||||
| 255 | d->context->doneCurrent(); | - | ||||||||||||
| 256 | } never executed: end of block | 0 | ||||||||||||
| 257 | - | |||||||||||||
| 258 | - | |||||||||||||
| 259 | - | |||||||||||||
| 260 | - | |||||||||||||
| 261 | QOpenGLContext *QOpenGLWindow::context() const | - | ||||||||||||
| 262 | { | - | ||||||||||||
| 263 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 264 | return never executed: d->context.data();return d->context.data();never executed: return d->context.data(); | 0 | ||||||||||||
| 265 | } | - | ||||||||||||
| 266 | - | |||||||||||||
| 267 | - | |||||||||||||
| 268 | - | |||||||||||||
| 269 | - | |||||||||||||
| 270 | QOpenGLContext *QOpenGLWindow::shareContext() const | - | ||||||||||||
| 271 | { | - | ||||||||||||
| 272 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 273 | return never executed: d->shareContext;return d->shareContext;never executed: return d->shareContext; | 0 | ||||||||||||
| 274 | } | - | ||||||||||||
| 275 | GLuint QOpenGLWindow::defaultFramebufferObject() const | - | ||||||||||||
| 276 | { | - | ||||||||||||
| 277 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 278 | if (d->updateBehavior > NoPartialUpdate
| 0 | ||||||||||||
| 279 | return never executed: d->fbo->handle();return d->fbo->handle();never executed: return d->fbo->handle(); | 0 | ||||||||||||
| 280 | else if (QOpenGLContext *ctx = QOpenGLContext::currentContext()
| 0 | ||||||||||||
| 281 | return never executed: ctx->defaultFramebufferObject();return ctx->defaultFramebufferObject();never executed: return ctx->defaultFramebufferObject(); | 0 | ||||||||||||
| 282 | else | - | ||||||||||||
| 283 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 284 | } | - | ||||||||||||
| 285 | - | |||||||||||||
| 286 | extern __attribute__((visibility("default"))) QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); | - | ||||||||||||
| 287 | QImage QOpenGLWindow::grabFramebuffer() | - | ||||||||||||
| 288 | { | - | ||||||||||||
| 289 | if (!isValid()
| 0 | ||||||||||||
| 290 | return never executed: QImage();return QImage();never executed: return QImage(); | 0 | ||||||||||||
| 291 | - | |||||||||||||
| 292 | makeCurrent(); | - | ||||||||||||
| 293 | return never executed: qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);never executed: return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false); | 0 | ||||||||||||
| 294 | } | - | ||||||||||||
| 295 | void QOpenGLWindow::initializeGL() | - | ||||||||||||
| 296 | { | - | ||||||||||||
| 297 | } | - | ||||||||||||
| 298 | void QOpenGLWindow::resizeGL(int w, int h) | - | ||||||||||||
| 299 | { | - | ||||||||||||
| 300 | (void)w;; | - | ||||||||||||
| 301 | (void)h;; | - | ||||||||||||
| 302 | } never executed: end of block | 0 | ||||||||||||
| 303 | void QOpenGLWindow::paintGL() | - | ||||||||||||
| 304 | { | - | ||||||||||||
| 305 | } | - | ||||||||||||
| 306 | void QOpenGLWindow::paintUnderGL() | - | ||||||||||||
| 307 | { | - | ||||||||||||
| 308 | } | - | ||||||||||||
| 309 | void QOpenGLWindow::paintOverGL() | - | ||||||||||||
| 310 | { | - | ||||||||||||
| 311 | } | - | ||||||||||||
| 312 | - | |||||||||||||
| 313 | - | |||||||||||||
| 314 | - | |||||||||||||
| 315 | - | |||||||||||||
| 316 | - | |||||||||||||
| 317 | - | |||||||||||||
| 318 | void QOpenGLWindow::paintEvent(QPaintEvent *event) | - | ||||||||||||
| 319 | { | - | ||||||||||||
| 320 | (void)event;; | - | ||||||||||||
| 321 | paintGL(); | - | ||||||||||||
| 322 | } never executed: end of block | 0 | ||||||||||||
| 323 | - | |||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| 326 | - | |||||||||||||
| 327 | - | |||||||||||||
| 328 | - | |||||||||||||
| 329 | void QOpenGLWindow::resizeEvent(QResizeEvent *event) | - | ||||||||||||
| 330 | { | - | ||||||||||||
| 331 | (void)event;; | - | ||||||||||||
| 332 | QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 333 | d->initialize(); | - | ||||||||||||
| 334 | resizeGL(width(), height()); | - | ||||||||||||
| 335 | } never executed: end of block | 0 | ||||||||||||
| 336 | - | |||||||||||||
| 337 | - | |||||||||||||
| 338 | - | |||||||||||||
| 339 | - | |||||||||||||
| 340 | int QOpenGLWindow::metric(PaintDeviceMetric metric) const | - | ||||||||||||
| 341 | { | - | ||||||||||||
| 342 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 343 | - | |||||||||||||
| 344 | switch (metric) { | - | ||||||||||||
| 345 | case never executed: PdmDepth:case PdmDepth:never executed: case PdmDepth: | 0 | ||||||||||||
| 346 | if (d->paintDevice
| 0 | ||||||||||||
| 347 | return never executed: d->paintDevice->depth();return d->paintDevice->depth();never executed: return d->paintDevice->depth(); | 0 | ||||||||||||
| 348 | break; never executed: break; | 0 | ||||||||||||
| 349 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 350 | break; never executed: break; | 0 | ||||||||||||
| 351 | } | - | ||||||||||||
| 352 | return never executed: QPaintDeviceWindow::metric(metric);return QPaintDeviceWindow::metric(metric);never executed: return QPaintDeviceWindow::metric(metric); | 0 | ||||||||||||
| 353 | } | - | ||||||||||||
| 354 | - | |||||||||||||
| 355 | - | |||||||||||||
| 356 | - | |||||||||||||
| 357 | - | |||||||||||||
| 358 | QPaintDevice *QOpenGLWindow::redirected(QPoint *) const | - | ||||||||||||
| 359 | { | - | ||||||||||||
| 360 | const QOpenGLWindowPrivate * const d = d_func(); | - | ||||||||||||
| 361 | if (QOpenGLContext::currentContext() == d->context.data()
| 0 | ||||||||||||
| 362 | return never executed: d->paintDevice.data();return d->paintDevice.data();never executed: return d->paintDevice.data(); | 0 | ||||||||||||
| 363 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 364 | } | - | ||||||||||||
| 365 | - | |||||||||||||
| 366 | - | |||||||||||||
| Switch to Source code | Preprocessed file |