From 436b331b7127124b9720bf7a3f915439f2a25cf3 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 18 Jun 2020 03:30:47 +0200 Subject: 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 --- src/plugins/platforms/eglfs/api/qeglfscursor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs') 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; -- cgit v1.2.3