diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-10-06 08:26:48 +0300 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-10-06 08:30:50 +0300 |
commit | dde0a87329a9e48f82c16c383a42ce42c5422351 (patch) | |
tree | 87024f784f8096b94489521abc4b692cd1b70a8f /doc/src/snippets/code/doc_src_examples_imageviewer.cpp | |
parent | 0ca343973a8417da2bb5bea1e5c3d8ac525f2815 (diff) | |
download | qt4-tools-dde0a87329a9e48f82c16c383a42ce42c5422351.tar.gz |
Do not let QGLContext get out of sync when doing mixed VG-GL rendering
The default graphics system is openvg, this means that apps using
QGLWidget (despite the official recommendation), without explicitly
setting opengl as the graphics system will use both the openvg and
opengl modules to perform rendering. This presents some problems
because QtOpenGL's comes with its own wrapper over QEglContext,
and making a foreign QEglContext (e.g. from VG) current will cause
its state to get out of sync, resulting in various drawing issues
due to skipped makeCurrent and similar calls.
The patch works this around by querying the current context from
EGL in QGLContext::currentContext() and returning null if the
EGLContext does not match. This somewhat ugly workaround ensures
that at least QGLContext::currentContext() will not lie: It will
not return a valid pointer when the underlying QEglContext's
underlying EGLContext is not actually the current context. This
will allow e.g. QGLPaintDevice::beginPaint to correctly recognize
the need for making the GL widget's context current and thus
avoid various rendering issues in certain games.
Task-number: QTTH-1553
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'doc/src/snippets/code/doc_src_examples_imageviewer.cpp')
0 files changed, 0 insertions, 0 deletions