summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-08-08 01:00:08 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-08-08 01:00:08 +0200
commit2b38408cbc23816034f087779d351f4db2ee4b1b (patch)
treec97a6881875331c7ef4b9aecf896434071382a46 /src/gui/kernel
parent0ea7360eaa70c2b024a37b2ff9106531440cdee7 (diff)
parent36cc171b9314bf77fc84d4273dceb6264aef7134 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp3
-rw-r--r--src/gui/kernel/qplatformintegration.cpp3
-rw-r--r--src/gui/kernel/qplatformintegration.h3
-rw-r--r--src/gui/kernel/qsurface.cpp6
4 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index b677afc526..3d9f1309c9 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -976,11 +976,8 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
if (!surface->surfaceHandle())
return false;
if (!surface->supportsOpenGL()) {
-#ifndef Q_OS_WASM // ### work around the WASM platform plugin using QOpenGLContext with raster surfaces.
- // see QTBUG-70076
qWarning() << "QOpenGLContext::makeCurrent() called with non-opengl surface" << surface;
return false;
-#endif
}
if (!d->platformGLContext->makeCurrent(surface->surfaceHandle()))
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 490cfc6178..b3d3db0751 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -244,6 +244,9 @@ QPlatformServices *QPlatformIntegration::services() const
\value TopStackedNativeChildWindows The platform supports native child windows via
QWindowContainer without having to punch a transparent hole in the
backingstore. (since 5.10)
+
+ \value OpenGLOnRasterSurface The platform supports making a QOpenGLContext current
+ in combination with a QWindow of type RasterSurface.
*/
/*!
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 389b35dbc0..a3594042ce 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -105,7 +105,8 @@ public:
AllGLFunctionsQueryable,
ApplicationIcon,
SwitchableWidgetComposition,
- TopStackedNativeChildWindows
+ TopStackedNativeChildWindows,
+ OpenGLOnRasterSurface
};
virtual ~QPlatformIntegration() { }
diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp
index 415e64b39c..709f28d431 100644
--- a/src/gui/kernel/qsurface.cpp
+++ b/src/gui/kernel/qsurface.cpp
@@ -39,6 +39,8 @@
#include "qsurface.h"
#include "qopenglcontext.h"
+#include <qpa/qplatformintegration.h>
+#include <QtGui/private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
@@ -103,6 +105,10 @@ QT_BEGIN_NAMESPACE
bool QSurface::supportsOpenGL() const
{
SurfaceType type = surfaceType();
+ if (type == RasterSurface) {
+ QPlatformIntegration *integ = QGuiApplicationPrivate::instance()->platformIntegration();
+ return integ->hasCapability(QPlatformIntegration::OpenGLOnRasterSurface);
+ }
return type == OpenGLSurface || type == RasterGLSurface;
}