Details
Description
The QGLContextGroup, QGLContextResource, and QGLSharedResourceGuard need to be based on QGuiGLContext instead of QGLContext, and possible be made public. QGuiGLContext should have thread affinity as well, which it gets by being a QObject sub-class.
Thus, when a QImage that is also cached as a GL texture is destroyed, we can check if a QGuiGLContext from the same group is owned by the current thread. If it is, we can make that context temporarily current in this thread, and destroy the GL texture resource. Otherwise, we need to send an event to a thread that does have a GL context from the same group, telling it to clean up the GL texture resource. This might require some thought to get right.
Potentially some signals like aboutToBeDestroyed() are needed too.
Attachments
For Gerrit Dashboard: QTBUG-20083 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
12126,3 | Introduced QOpenGLContext::aboutToBeDestroyed() signal. | master | qt/qtbase | Status: MERGED | +2 | 0 |