Tor Arne Vestbø 2656666e71 QOpenGL2PaintEngineEx: Store context via QPointer
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.

Change-Id: I5c221a37fd95f846d96e72509bba54f3d10fee3a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 8f6b27fdeef4f45d70c7bc93f7393f58f5ddeb16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 21:24:42 +00:00
2024-05-28 09:40:56 +00:00
2020-11-16 10:02:08 +02:00
2015-08-18 19:59:14 +00:00
2024-04-25 05:33:41 +01:00
2024-02-02 15:28:34 +00:00
2024-04-22 14:01:15 +00:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%