From c9ddc4b8e17fac10d2f25fe21c09bdd734513ac6 Mon Sep 17 00:00:00 2001 From: Tuomas Vaarala Date: Wed, 15 May 2024 13:21:08 +0300 Subject: [PATCH] [QNX] Use QRhiBackingstore for non-raster surface windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the change to use compose render-to-texture widgets through QRhi, the RasterGLSurface is not existing anymore and it was used in QNX QPA to check the support for using backingstore with non-raster windows. With the use of QRhiBackingstore the QNX QPA now supports render-to-texture widgets for non-raster surface windows. Fixes: QTBUG-114938 Task-number: QTBUG-114938 Pick-to: 6.5 6.6 6.7 Change-Id: I01d4a34efe4902a527051776b0460ccf22e5d232 Reviewed-by: Tor Arne Vestbø Reviewed-by: Marianne Yrjänä --- src/gui/CMakeLists.txt | 6 ++++++ src/plugins/platforms/qnx/qqnxintegration.cpp | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 9f76e7afa1f..aed66563a79 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -414,6 +414,12 @@ qt_internal_extend_target(Gui CONDITION APPLE ${FWImageIO} ) +qt_internal_extend_target(Gui CONDITION QNX + SOURCES + painting/qrasterbackingstore.cpp painting/qrasterbackingstore_p.h + painting/qrhibackingstore.cpp painting/qrhibackingstore_p.h +) + qt_internal_extend_target(Gui CONDITION QT_FEATURE_animation SOURCES animation/qguivariantanimation.cpp diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index cc10f6a00e2..b308c956f29 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -49,6 +49,7 @@ #include #include +#include #if !defined(QT_NO_OPENGL) #include "qqnxglcontext.h" @@ -328,8 +329,19 @@ QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const { - qCDebug(lcQpaQnx) << Q_FUNC_INFO; - return new QQnxRasterBackingStore(window); + QSurface::SurfaceType surfaceType = window->surfaceType(); + qCDebug(lcQpaQnx) << Q_FUNC_INFO << surfaceType; + switch (surfaceType) { + case QSurface::RasterSurface: + return new QQnxRasterBackingStore(window); +#if !defined(QT_NO_OPENGL) + // Return a QRhiBackingStore for non-raster surface windows + case QSurface::OpenGLSurface: + return new QRhiBackingStore(window); +#endif + default: + return nullptr; + } } #if !defined(QT_NO_OPENGL)