From 53a6f7b7836ef5084106ed63f6745c20d663affa Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 6 Aug 2019 13:15:35 +0200 Subject: eglfs: Fix raster windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept of true raster windows. A QWindow with RasterSurface is rendered with OpenGL no matter what. The two platforms took two different approaches to work around the rest of the machinery: - wasm disabled the QOpenGLContext warning for non-OpenGL QWindows, - eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was originally set to RasterSurface. Now, the latter breaks since c4e9eabc309a275efc222f4127f31ba4677259b7, leaving all raster window applications failing on eglfs, because flush in the backingstore is now checking the surface type and disallows OpenGLSurface windows. (just like how QOpenGLContext disallows RasterSurface windows) To solve all this correctly, introduce a new platform capability, OpenGLOnRasterSurface, and remove the special handling in the platform plugins. Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c Fixes: QTBUG-77100 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/eglfs/api/qeglfsintegration.cpp | 1 + src/plugins/platforms/eglfs/api/qeglfswindow.cpp | 9 ++------- src/plugins/platforms/eglfs/api/qeglfswindow_p.h | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms/eglfs/api') diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp index c8a1ddf9b9..674f579b4f 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp @@ -265,6 +265,7 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons case RasterGLSurface: return false; #endif case WindowManagement: return false; + case OpenGLOnRasterSurface: return true; default: return QPlatformIntegration::hasCapability(cap); } } diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index c1d5af47aa..1fed182882 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -64,7 +64,6 @@ QEglFSWindow::QEglFSWindow(QWindow *w) m_backingStore(0), m_rasterCompositingContext(0), #endif - m_raster(false), m_winId(0), m_surface(EGL_NO_SURFACE), m_window(0), @@ -94,11 +93,6 @@ void QEglFSWindow::create() m_winId = newWId(); - // Save the original surface type before changing to OpenGLSurface. - m_raster = (window()->surfaceType() == QSurface::RasterSurface); - if (m_raster) // change to OpenGL, but not for RasterGLSurface - window()->setSurfaceType(QSurface::OpenGLSurface); - if (window()->type() == Qt::Desktop) { QRect fullscreenRect(QPoint(), screen()->availableGeometry().size()); QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect); @@ -329,7 +323,8 @@ QEglFSScreen *QEglFSWindow::screen() const bool QEglFSWindow::isRaster() const { - return m_raster || window()->surfaceType() == QSurface::RasterGLSurface; + const QWindow::SurfaceType type = window()->surfaceType(); + return type == QSurface::RasterSurface || type == QSurface::RasterGLSurface; } #ifndef QT_NO_OPENGL diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h index b0091e2a62..be2a0630d3 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h @@ -118,7 +118,6 @@ protected: QOpenGLCompositorBackingStore *m_backingStore; QOpenGLContext *m_rasterCompositingContext; #endif - bool m_raster; WId m_winId; EGLSurface m_surface; -- cgit v1.2.3