diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-11-15 22:26:55 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-11-27 14:55:17 +0000 |
commit | 7f6497e623fd66e0dc1ecab89ef16533154a6472 (patch) | |
tree | 97e60a6ab50b1a5392b21c1e6c12fac8e97ff9e4 /LICENSE.LGPL3 | |
parent | 71bd06d516a2410ae0ea698e79dcb94aba9bc5b4 (diff) |
Ensure QOpenGLWidget FBO is always initialized
QOpenGLWidget uses an FBO internally, that is glCleared whenever
recreated. But for the clear to be visible across shared contexts
we must also issue a glFlush.
QOpenGLWidget defers this flush until the compositing step, in
QOpenGLWidgetPrivate::beginCompose(), based on a flushPending
variable.
This variable is set either after invoking the user's paintGL()
function, or when opening a QPainter on the QOpenGLWidget, via
QOpenGLWidgetPaintDevice::ensureActiveTarget().
Unfortunately, if QOpenGLWidget::paintEvent() is overridden or
intercepted (meaning we will not end up calling paintGL()), but
the overridden paint event does not open a QPainter, we end up
never setting flushPending to true, and end up composing an
uninitialized FBO.
This can lead to rendering issues, or even kernel panics with
some unfortunate GL drivers.
The fix is to ensure the glClear is always flushed before
composing, by forcing a pending flush whenever the FBO is
recreated.
Fixes: QTBUG-70921
Change-Id: I72b596c09dcf54bd0f37668062daaad2d6f7f4bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'LICENSE.LGPL3')
0 files changed, 0 insertions, 0 deletions