summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp11
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h1
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp4
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp2
4 files changed, 15 insertions, 3 deletions
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
index bb3ea6981a..6f71fb637f 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
@@ -71,6 +71,7 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
: QPlatformBackingStore(window),
m_window(window),
m_bsTexture(0),
+ m_bsTextureContext(0),
m_textures(new QPlatformTextureList),
m_lockedWidgetTextures(0)
{
@@ -78,6 +79,14 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
{
+ if (m_bsTexture) {
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (ctx && m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
+ glDeleteTextures(1, &m_bsTexture);
+ else
+ qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context");
+ }
+
delete m_textures;
}
@@ -89,6 +98,8 @@ QPaintDevice *QOpenGLCompositorBackingStore::paintDevice()
void QOpenGLCompositorBackingStore::updateTexture()
{
if (!m_bsTexture) {
+ m_bsTextureContext = QOpenGLContext::currentContext();
+ Q_ASSERT(m_bsTextureContext);
glGenTextures(1, &m_bsTexture);
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
index 49d8bfd6e7..bd843e8bd9 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
@@ -83,6 +83,7 @@ private:
QImage m_image;
QRegion m_dirty;
uint m_bsTexture;
+ QOpenGLContext *m_bsTextureContext;
QPlatformTextureList *m_textures;
QPlatformTextureList *m_lockedWidgetTextures;
};
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index b59ae431f4..33cb4391f0 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -134,7 +134,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
return openDocument(url);
if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
- qWarning("%s: Unable to detect a web browser to launch '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
+ qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_webBrowser, url);
@@ -143,7 +143,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
bool QGenericUnixServices::openDocument(const QUrl &url)
{
if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) {
- qWarning("%s: Unable to detect a launcher for '%s'", Q_FUNC_INFO, qPrintable(url.toString()));
+ qWarning("Unable to detect a launcher for '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_documentLauncher, url);
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 60fb7e2cce..ee62710913 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -546,7 +546,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
kdeDirs.removeDuplicates();
if (kdeDirs.isEmpty()) {
- qWarning("%s: Unable to determine KDE dirs", Q_FUNC_INFO);
+ qWarning("Unable to determine KDE dirs");
return 0;
}