diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2024-05-30 11:40:54 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2024-05-30 22:23:35 +0200 |
commit | 8f6b27fdeef4f45d70c7bc93f7393f58f5ddeb16 (patch) | |
tree | ceb387b06e5f3b824bcfc59a8e4e0ec48195826b /src/gui/doc/examples | |
parent | 3c9bb0daaf0cbff9135f88e55bae8243aa937faa (diff) |
The QOpenGLBuffers used by QOpenGL2PaintEngineEx are tied to a specific
share group on creation, via QOpenGLSharedResourceGuard.
If QOpenGL2PaintEngineEx is later used with a recreated QOpenGLContext,
that happens to live at the same address as the previous one, we will
fail to detect that the context has changed by using a naked pointer
comparison (ABA problem).
If the share group of the new context is different, this will cause
problems down the line in QOpenGLBuffers::bind(). This scenario has
been observed on Android, where the context created in
QOpenGLWidgetPrivate::initialize() ends up with the same address,
but then adopts a new share context from RHI, because the widget has
been moved to a different top level window.
To remedy this, we store the QOpenGL2PaintEngineEx's cached context
via a QPointer, so that we pick up the B state of ABA (null), and
correctly throw away the old buffers in QOpenGL2PaintEngineEx::begin.
Pick-to: 6.7
Change-Id: I5c221a37fd95f846d96e72509bba54f3d10fee3a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/doc/examples')
0 files changed, 0 insertions, 0 deletions