diff options
Diffstat (limited to 'src/plugins/platforms')
18 files changed, 97 insertions, 22 deletions
diff --git a/src/plugins/platforms/android/android.pro b/src/plugins/platforms/android/android.pro index 61cac51633..8ea78f7cba 100644 --- a/src/plugins/platforms/android/android.pro +++ b/src/plugins/platforms/android/android.pro @@ -9,6 +9,8 @@ QT += \ qtConfig(vulkan): QT += vulkan_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + OTHER_FILES += $$PWD/android.json INCLUDEPATH += \ diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index e0c437be27..ae584965e6 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -43,6 +43,9 @@ #include <QtGui/private/qguiapplication_p.h> #include <QGuiApplication> #include <QOpenGLContext> +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif #include <QThread> #include <QOffscreenSurface> @@ -275,7 +278,12 @@ QPlatformBackingStore *QAndroidPlatformIntegration::createPlatformBackingStore(Q { if (!QtAndroid::activity()) return nullptr; - return new QAndroidPlatformBackingStore(window); + + auto *backingStore = new QAndroidPlatformBackingStore(window); +#if QT_CONFIG(opengl) + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif // QT_CONFIG(opengl) + return backingStore; } QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index a919963cf4..953346c56e 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -101,6 +101,8 @@ QT += \ qtConfig(vulkan): QT += vulkan_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + CONFIG += no_app_extension_api_only qtHaveModule(widgets) { diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index a77b97f538..b2698b05fe 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -68,6 +68,10 @@ #include <QtFontDatabaseSupport/private/qfontengine_coretext_p.h> +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif + #ifdef QT_WIDGETS_LIB #include <QtWidgets/qtwidgetsglobal.h> #if QT_CONFIG(filedialog) @@ -324,10 +328,16 @@ QPlatformBackingStore *QCocoaIntegration::createPlatformBackingStore(QWindow *wi return nullptr; } + QPlatformBackingStore *backingStore = nullptr; if (platformWindow->view().layer) - return new QCALayerBackingStore(window); + backingStore = new QCALayerBackingStore(window); else - return new QNSWindowBackingStore(window); + backingStore = new QNSWindowBackingStore(window); + +#if QT_CONFIG(opengl) + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif + return backingStore; } QAbstractEventDispatcher *QCocoaIntegration::createEventDispatcher() const diff --git a/src/plugins/platforms/ios/kernel.pro b/src/plugins/platforms/ios/kernel.pro index 71257d09f7..01e0105223 100644 --- a/src/plugins/platforms/ios/kernel.pro +++ b/src/plugins/platforms/ios/kernel.pro @@ -9,6 +9,8 @@ QT += \ core-private gui-private \ clipboard_support-private fontdatabase_support-private graphics_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + LIBS += -framework Foundation -framework UIKit -framework QuartzCore -framework AudioToolbox OBJECTIVE_SOURCES = \ diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index 9eca0eaad3..d724e65717 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -65,6 +65,10 @@ #import <AudioToolbox/AudioServices.h> +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif + #include <QtDebug> QT_BEGIN_NAMESPACE @@ -186,7 +190,11 @@ QPlatformWindow *QIOSIntegration::createPlatformWindow(QWindow *window) const // Used when the QWindow's surface type is set by the client to QSurface::RasterSurface QPlatformBackingStore *QIOSIntegration::createPlatformBackingStore(QWindow *window) const { - return new QIOSBackingStore(window); + auto *backingStore = new QIOSBackingStore(window); +#if QT_CONFIG(opengl) + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif + return backingStore; } // Used when the QWindow's surface type is set by the client to QSurface::OpenGLSurface diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index 6bf0d69770..74890ead82 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -36,7 +36,6 @@ #include <QtGui/private/qwindow_p.h> #include <QtGui/qopenglcontext.h> #include <QtGui/qopenglfunctions.h> -#include <QtGui/qopengltextureblitter.h> #include <QtGui/qoffscreensurface.h> #include <QtGui/qpainter.h> #include <private/qpixmapcache_p.h> diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h index 6b59d87a0a..250d244c9f 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.h +++ b/src/plugins/platforms/wasm/qwasmcompositor.h @@ -33,7 +33,7 @@ #include <QtGui/qregion.h> #include <qpa/qplatformwindow.h> -#include <QtGui/qopengltextureblitter.h> +#include <QtOpenGL/qopengltextureblitter.h> #include <QtGui/qpalette.h> #include <QtGui/qpainter.h> @@ -43,7 +43,6 @@ class QWasmWindow; class QWasmScreen; class QOpenGLContext; class QOpenGLTexture; -class QOpenGLTextureBlitter; class QWasmCompositedWindow { diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index fd53cd0bae..ce83ad4e2f 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -41,6 +41,7 @@ #include "qwasmwindow.h" #ifndef QT_NO_OPENGL # include "qwasmbackingstore.h" +# include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> #endif #include "qwasmfontdatabase.h" #if defined(Q_OS_UNIX) @@ -185,6 +186,7 @@ QPlatformBackingStore *QWasmIntegration::createPlatformBackingStore(QWindow *win #ifndef QT_NO_OPENGL QWasmCompositor *compositor = QWasmScreen::get(window->screen())->compositor(); QWasmBackingStore *backingStore = new QWasmBackingStore(compositor, window); + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); m_backingStores.insert(window, backingStore); return backingStore; #else diff --git a/src/plugins/platforms/wasm/wasm.pro b/src/plugins/platforms/wasm/wasm.pro index c8b28fb37d..1aee4a3e58 100644 --- a/src/plugins/platforms/wasm/wasm.pro +++ b/src/plugins/platforms/wasm/wasm.pro @@ -4,6 +4,8 @@ QT += \ core-private gui-private \ eventdispatcher_support-private fontdatabase_support-private egl_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + # Avoid X11 header collision, use generic EGL native types DEFINES += QT_EGL_NO_X11 diff --git a/src/plugins/platforms/windows/qwindowsgdiintegration.cpp b/src/plugins/platforms/windows/qwindowsgdiintegration.cpp index c88f669eb5..7e9595321a 100644 --- a/src/plugins/platforms/windows/qwindowsgdiintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsgdiintegration.cpp @@ -45,6 +45,10 @@ #include <QtCore/qdebug.h> #include <QtGui/private/qpixmap_raster_p.h> +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif + QT_BEGIN_NAMESPACE class QWindowsGdiIntegrationPrivate @@ -73,7 +77,11 @@ QPlatformPixmap *QWindowsGdiIntegration::createPlatformPixmap(QPlatformPixmap::P QPlatformBackingStore *QWindowsGdiIntegration::createPlatformBackingStore(QWindow *window) const { - return new QWindowsBackingStore(window); + auto *backingStore = new QWindowsBackingStore(window); +#ifndef QT_NO_OPENGL + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif + return backingStore; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 4b4047ac0c..77340387d8 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -48,6 +48,9 @@ #include "qwindowsscreen.h" #include "qwindowstheme.h" #include "qwindowsservices.h" +#ifdef QT_USE_DIRECTWRITE3 +#include <QtFontDatabaseSupport/private/qwindowsdirectwritefontdatabase_p.h> +#endif #ifndef QT_NO_FREETYPE # include <QtFontDatabaseSupport/private/qwindowsfontdatabase_ft_p.h> #endif @@ -187,7 +190,9 @@ static inline unsigned parseOptions(const QStringList ¶mList, unsigned options = 0; for (const QString ¶m : paramList) { if (param.startsWith(u"fontengine=")) { - if (param.endsWith(u"freetype")) { + if (param.endsWith(u"directwrite")) { + options |= QWindowsIntegration::FontDatabaseDirectWrite; + } else if (param.endsWith(u"freetype")) { options |= QWindowsIntegration::FontDatabaseFreeType; } else if (param.endsWith(u"native")) { options |= QWindowsIntegration::FontDatabaseNative; @@ -504,14 +509,17 @@ QWindowsStaticOpenGLContext *QWindowsIntegration::staticOpenGLContext() QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const { if (!d->m_fontDatabase) { -#ifdef QT_NO_FREETYPE - d->m_fontDatabase = new QWindowsFontDatabase(); -#else // QT_NO_FREETYPE +#ifdef QT_USE_DIRECTWRITE3 + if (d->m_options & QWindowsIntegration::FontDatabaseDirectWrite) + d->m_fontDatabase = new QWindowsDirectWriteFontDatabase; + else +#endif +#ifndef QT_NO_FREETYPE if (d->m_options & QWindowsIntegration::FontDatabaseFreeType) d->m_fontDatabase = new QWindowsFontDatabaseFT; else - d->m_fontDatabase = new QWindowsFontDatabase; #endif // QT_NO_FREETYPE + d->m_fontDatabase = new QWindowsFontDatabase(); } return d->m_fontDatabase; } diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h index 1f16d13769..165472ad40 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.h +++ b/src/plugins/platforms/windows/qwindowsintegration.h @@ -72,7 +72,8 @@ public: DetectAltGrModifier = 0x800, RtlEnabled = 0x1000, DarkModeWindowFrames = 0x2000, - DarkModeStyle = 0x4000 + DarkModeStyle = 0x4000, + FontDatabaseDirectWrite = 0x8000 }; explicit QWindowsIntegration(const QStringList ¶mList); diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro index 50a3bb41a9..8a27bd2770 100644 --- a/src/plugins/platforms/windows/windows.pro +++ b/src/plugins/platforms/windows/windows.pro @@ -5,6 +5,8 @@ QT += \ eventdispatcher_support-private \ fontdatabase_support-private theme_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + qtConfig(accessibility): QT += accessibility_support-private qtConfig(vulkan): QT += vulkan_support-private diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp index 27d3746933..dd8cd80fd9 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.cpp +++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp @@ -53,6 +53,9 @@ #if QT_CONFIG(accessibility) # include "uiautomation/qwinrtuiaaccessibility.h" #endif +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif #include <QtGui/QOffscreenSurface> #include <QtGui/QOpenGLContext> @@ -205,7 +208,11 @@ QPlatformWindow *QWinRTIntegration::createPlatformWindow(QWindow *window) const QPlatformBackingStore *QWinRTIntegration::createPlatformBackingStore(QWindow *window) const { - return new QWinRTBackingStore(window); + auto *backingStore = new QWinRTBackingStore(window); +#if QT_CONFIG(opengl) + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif + return backingStore; } QPlatformOpenGLContext *QWinRTIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro index 43dc8f074c..7ac49f73c4 100644 --- a/src/plugins/platforms/winrt/winrt.pro +++ b/src/plugins/platforms/winrt/winrt.pro @@ -6,6 +6,8 @@ QT += \ core-private gui-private \ fontdatabase_support-private egl_support-private +qtHaveModule(platformcompositor_support-private): QT += platformcompositor_support-private + DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__ QMAKE_USE_PRIVATE += d3d11 ws2_32 diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 3fd989e1f9..cea0511822 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -61,6 +61,9 @@ #include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h> #include <QtServiceSupport/private/qgenericunixservices_p.h> +#if QT_CONFIG(opengl) +#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h> +#endif #include <stdio.h> @@ -288,16 +291,23 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const { - const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window); - if (isTrayIconWindow) - return new QXcbSystemTrayBackingStore(window); + QPlatformBackingStore *backingStore = nullptr; + const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window); + if (isTrayIconWindow) { + backingStore = new QXcbSystemTrayBackingStore(window); #if QT_CONFIG(xcb_native_painting) - if (nativePaintingEnabled()) - return new QXcbNativeBackingStore(window); + } else if (nativePaintingEnabled()) { + backingStore = new QXcbNativeBackingStore(window); #endif - - return new QXcbBackingStore(window); + } else { + backingStore = new QXcbBackingStore(window); + } + Q_ASSERT(backingStore); +#ifndef QT_NO_OPENGL + backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore)); +#endif + return backingStore; } QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index a5d05faa9c..1f651e7697 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -9,6 +9,9 @@ QT += \ edid_support-private \ xkbcommon_support-private +qtHaveModule(platformcompositor_support-private): \ + QT += platformcompositor_support-private + qtHaveModule(linuxaccessibility_support-private): \ QT += linuxaccessibility_support-private |