summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglcontext.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-06-18 03:30:47 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-06-22 12:48:30 +0200
commit436b331b7127124b9720bf7a3f915439f2a25cf3 (patch)
treeb3cd72c2a3d59dfbefd3aa6f0fe3dfcc9b513862 /src/gui/kernel/qopenglcontext.cpp
parentf1f0aa4a3a7d364b5110122a8f77079a7742c4e9 (diff)
Enable access to the VAO resolvers through QOpenGLContextPrivate
This is a commit in preparation for an upcoming change in QtQuick. We want to store the resolved functions for managing VAOs somewhere; the "least worst" choice is next to the all other function resolvers, which are in QOpenGLContext(Private). To avoid moving the VAO resolvers themselves, leave a hook in QOGLCPrivate, similar to e.g. the texture function resolvers. The hook gets populated when the VAO resolvers for a given context are requested. This removes memory management burden from the users of those functions (again, just like other function resolvers), and makes the initialization of the functions automatic. Change-Id: I0eba30a85bf8ad82946a5d68e91009d8b4bd91cf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index d164f44e73..5c6d082f98 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -484,6 +484,13 @@ void QOpenGLContext::destroy()
}
d->textureFunctions = nullptr;
+ if (d->vaoHelperDestroyCallback) {
+ Q_ASSERT(d->vaoHelper);
+ d->vaoHelperDestroyCallback(d->vaoHelper);
+ d->vaoHelperDestroyCallback = nullptr;
+ }
+ d->vaoHelper = nullptr;
+
d->nativeHandle = QVariant();
}