diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-18 03:30:47 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-22 12:48:30 +0200 |
commit | 436b331b7127124b9720bf7a3f915439f2a25cf3 (patch) | |
tree | b3cd72c2a3d59dfbefd3aa6f0fe3dfcc9b513862 /src/plugins/platforms/eglfs | |
parent | f1f0aa4a3a7d364b5110122a8f77079a7742c4e9 (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/plugins/platforms/eglfs')
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfscursor.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp index 1be61504de..29b15e5926 100644 --- a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp @@ -375,7 +375,7 @@ struct StateSaver { StateSaver() { f = QOpenGLContext::currentContext()->functions(); - vaoHelper = new QOpenGLVertexArrayObjectHelper(QOpenGLContext::currentContext()); + vaoHelper = QOpenGLVertexArrayObjectHelper::vertexArrayObjectHelperForContext(QOpenGLContext::currentContext()); static bool windowsChecked = false; static bool shouldSave = true; @@ -446,7 +446,6 @@ struct StateSaver f->glVertexAttribPointer(i, va[i].size, va[i].type, va[i].normalized, va[i].stride, va[i].pointer); } } - delete vaoHelper; } QOpenGLFunctions *f; QOpenGLVertexArrayObjectHelper *vaoHelper; |