diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-12-12 12:58:11 +0100 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2020-01-20 15:03:15 +0100 |
commit | 06bb315beb6c2c398223cfe52cbc7f66e14a8557 (patch) | |
tree | 5224974a8d2cfa34780809ed87be82a7f544827e /src/gui/kernel/qopenglcontext.cpp | |
parent | 35a461d0261af4178e560df3e3c8fd6fd19bdeb5 (diff) |
Remove QOpenGLTextureHelper dependency from QOpenGLContext
It's now just a pointer to a forward declared class
Task-number: QTBUG-74409
Change-Id: I34df385154dcff2bbba2f6318825ab5258fa6695
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 124b39f2a9..ab71434c13 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -56,8 +56,6 @@ #include <private/qopenglextensions_p.h> #include <private/qopenglversionfunctionsfactory_p.h> -#include <private/qopengltexturehelper_p.h> - #include <QDebug> #ifndef QT_OPENGL_ES_2 @@ -664,7 +662,10 @@ void QOpenGLContext::destroy() qDeleteAll(d->versionFunctions); d->versionFunctions.clear(); - delete d->textureFunctions; + if (d->textureFunctionsDestroyCallback) { + d->textureFunctionsDestroyCallback(); + d->textureFunctionsDestroyCallback = nullptr; + } d->textureFunctions = nullptr; d->nativeHandle = QVariant(); @@ -1388,10 +1389,11 @@ QOpenGLTextureHelper* QOpenGLContext::textureFunctions() const /*! \internal */ -void QOpenGLContext::setTextureFunctions(QOpenGLTextureHelper* textureFuncs) +void QOpenGLContext::setTextureFunctions(QOpenGLTextureHelper* textureFuncs, std::function<void()> destroyCallback) { Q_D(QOpenGLContext); d->textureFunctions = textureFuncs; + d->textureFunctionsDestroyCallback = destroyCallback; } /*! |