diff options
Diffstat (limited to 'src/plugins/platforms')
28 files changed, 167 insertions, 63 deletions
diff --git a/src/plugins/platforms/android/.prev_CMakeLists.txt b/src/plugins/platforms/android/.prev_CMakeLists.txt index 4cb966004e..7b21613fb9 100644 --- a/src/plugins/platforms/android/.prev_CMakeLists.txt +++ b/src/plugins/platforms/android/.prev_CMakeLists.txt @@ -69,6 +69,11 @@ qt_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_vulkan Qt::VulkanSupportPrivate ) +qt_extend_target(QAndroidIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_android_style_assets SOURCES extract.cpp diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt index 970c0de870..4d1f83053b 100644 --- a/src/plugins/platforms/android/CMakeLists.txt +++ b/src/plugins/platforms/android/CMakeLists.txt @@ -78,6 +78,11 @@ qt_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_vulkan Qt::VulkanSupportPrivate ) +qt_extend_target(QAndroidIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QAndroidIntegrationPlugin CONDITION QT_FEATURE_android_style_assets SOURCES extract.cpp 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/.prev_CMakeLists.txt b/src/plugins/platforms/cocoa/.prev_CMakeLists.txt index 27cace4eb9..1491340b65 100644 --- a/src/plugins/platforms/cocoa/.prev_CMakeLists.txt +++ b/src/plugins/platforms/cocoa/.prev_CMakeLists.txt @@ -107,6 +107,11 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionmanager qcocoasessionmanager.cpp qcocoasessionmanager.h ) +qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::Widgets SOURCES qpaintengine_mac.mm qpaintengine_mac_p.h @@ -114,7 +119,7 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::Widgets Qt::WidgetsPrivate ) -#### Keys ignored in scope 7:.:.:cocoa.pro:TARGET Qt::Widgets: +#### Keys ignored in scope 8:.:.:cocoa.pro:TARGET Qt::Widgets: # QT_FOR_CONFIG = "widgets" qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::PrintSupport AND TARGET Qt::Widgets @@ -141,5 +146,5 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_fontdialog AND TAR qcocoafontdialoghelper.h qcocoafontdialoghelper.mm ) -#### Keys ignored in scope 12:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 13:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 27b646d293..9e8b162aec 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -111,6 +111,11 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionmanager qcocoasessionmanager.cpp qcocoasessionmanager.h ) +qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::Widgets SOURCES qpaintengine_mac.mm qpaintengine_mac_p.h @@ -118,7 +123,7 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::Widgets Qt::WidgetsPrivate ) -#### Keys ignored in scope 7:.:.:cocoa.pro:TARGET Qt::Widgets: +#### Keys ignored in scope 8:.:.:cocoa.pro:TARGET Qt::Widgets: # QT_FOR_CONFIG = "widgets" qt_extend_target(QCocoaIntegrationPlugin CONDITION TARGET Qt::PrintSupport AND TARGET Qt::Widgets @@ -145,5 +150,5 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_fontdialog AND TAR qcocoafontdialoghelper.h qcocoafontdialoghelper.mm ) -#### Keys ignored in scope 12:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 13:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" 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/.prev_CMakeLists.txt b/src/plugins/platforms/ios/.prev_CMakeLists.txt index f23cf8c300..d7ff160ee0 100644 --- a/src/plugins/platforms/ios/.prev_CMakeLists.txt +++ b/src/plugins/platforms/ios/.prev_CMakeLists.txt @@ -1,12 +1,12 @@ # Generated from ios.pro. ##################################################################### -## qios Plugin: +## QIOSIntegrationPlugin Plugin: ##################################################################### -add_qt_plugin(qios +add_qt_plugin(QIOSIntegrationPlugin + OUTPUT_NAME qios TYPE platforms - CLASS_NAME QIOSIntegrationPlugin SOURCES plugin.mm qiosapplicationdelegate.h qiosapplicationdelegate.mm @@ -26,37 +26,30 @@ add_qt_plugin(qios qioswindow.h qioswindow.mm quiaccessibilityelement.h quiaccessibilityelement.mm quiview.h quiview.mm - LIBRARIES - Qt::ClipboardSupportPrivate - Qt::CorePrivate - Qt::FontDatabaseSupportPrivate - Qt::GraphicsSupportPrivate - Qt::GuiPrivate PUBLIC_LIBRARIES ${FWAudioToolbox} ${FWFoundation} ${FWQuartzCore} ${FWUIKit} - Qt::ClipboardSupport - Qt::Core - Qt::FontDatabaseSupport - Qt::GraphicsSupport - Qt::Gui + Qt::ClipboardSupportPrivate + Qt::CorePrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::GuiPrivate ) #### Keys ignored in scope 2:.:.:kernel.pro:<TRUE>: # OTHER_FILES = "quiview_textinput.mm" "quiview_accessibility.mm" -# PLUGIN_CLASS_NAME = "QIOSIntegrationPlugin" -# PLUGIN_TYPE = "platforms" -# _LOADED = "qt_plugin" ## Scopes: ##################################################################### -#### Keys ignored in scope 3:.:.:kernel.pro:QT_FEATURE_shared: -# CONFIG = "static" +extend_target(QIOSIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) -extend_target(qios CONDITION NOT APPLE_TVOS +extend_target(QIOSIntegrationPlugin CONDITION NOT APPLE_TVOS SOURCES qiosclipboard.h qiosclipboard.mm qiosfiledialog.h qiosfiledialog.mm @@ -67,15 +60,6 @@ extend_target(qios CONDITION NOT APPLE_TVOS ${FWAssetsLibrary} ) -#### Keys ignored in scope 5:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 6:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" add_subdirectory(optional) - - if(QT_FEATURE_shared) - endif() - - if(NOT APPLE_TVOS) - endif() - - if(NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN) - endif() diff --git a/src/plugins/platforms/ios/CMakeLists.txt b/src/plugins/platforms/ios/CMakeLists.txt index d8912866b0..d7ff160ee0 100644 --- a/src/plugins/platforms/ios/CMakeLists.txt +++ b/src/plugins/platforms/ios/CMakeLists.txt @@ -44,6 +44,11 @@ add_qt_plugin(QIOSIntegrationPlugin ## Scopes: ##################################################################### +extend_target(QIOSIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + extend_target(QIOSIntegrationPlugin CONDITION NOT APPLE_TVOS SOURCES qiosclipboard.h qiosclipboard.mm @@ -55,6 +60,6 @@ extend_target(QIOSIntegrationPlugin CONDITION NOT APPLE_TVOS ${FWAssetsLibrary} ) -#### Keys ignored in scope 5:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 6:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" add_subdirectory(optional) 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/.prev_CMakeLists.txt b/src/plugins/platforms/windows/.prev_CMakeLists.txt index 462e83ac56..57b7fede9f 100644 --- a/src/plugins/platforms/windows/.prev_CMakeLists.txt +++ b/src/plugins/platforms/windows/.prev_CMakeLists.txt @@ -86,6 +86,11 @@ qt_add_resource(QWindowsIntegrationPlugin "openglblacklists" ## Scopes: ##################################################################### +qt_extend_target(QWindowsIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_accessibility SOURCES uiautomation/qwindowsuiaaccessibility.cpp uiautomation/qwindowsuiaaccessibility.h @@ -117,7 +122,7 @@ qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_vulkan Qt::VulkanSupportPrivate ) -#### Keys ignored in scope 4:.:.:windows.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 5:.:.:windows.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl AND NOT QT_FEATURE_opengles2 diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 0481246384..0c903d8757 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -87,6 +87,11 @@ qt_add_resource(QWindowsIntegrationPlugin "openglblacklists" ## Scopes: ##################################################################### +qt_extend_target(QWindowsIntegrationPlugin CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_accessibility SOURCES uiautomation/qwindowsuiaaccessibility.cpp uiautomation/qwindowsuiaaccessibility.h @@ -118,7 +123,7 @@ qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_vulkan Qt::VulkanSupportPrivate ) -#### Keys ignored in scope 4:.:.:windows.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 5:.:.:windows.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" qt_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl AND NOT QT_FEATURE_opengles2 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/.prev_CMakeLists.txt b/src/plugins/platforms/xcb/.prev_CMakeLists.txt index e15d45aa63..427997fc66 100644 --- a/src/plugins/platforms/xcb/.prev_CMakeLists.txt +++ b/src/plugins/platforms/xcb/.prev_CMakeLists.txt @@ -66,6 +66,11 @@ qt_add_module(XcbQpa ## Scopes: ##################################################################### +qt_extend_target(XcbQpa CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate PUBLIC_LIBRARIES Qt::LinuxAccessibilitySupportPrivate @@ -150,12 +155,12 @@ qt_add_plugin(QXcbIntegrationPlugin Qt::XcbQpaPrivate ) -#### Keys ignored in scope 19:.:.:xcb-plugin.pro:<TRUE>: +#### Keys ignored in scope 20:.:.:xcb-plugin.pro:<TRUE>: # OTHER_FILES = "xcb.json" "README" ## Scopes: ##################################################################### -#### Keys ignored in scope 21:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 22:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" add_subdirectory(gl_integrations) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 1bb8d7f53f..d422d69891 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -89,6 +89,11 @@ qt_add_module(XcbQpa ## Scopes: ##################################################################### +qt_extend_target(XcbQpa CONDITION TARGET Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + qt_extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate PUBLIC_LIBRARIES Qt::LinuxAccessibilitySupportPrivate @@ -190,13 +195,13 @@ qt_add_plugin(QXcbIntegrationPlugin Qt::XcbQpaPrivate ) -#### Keys ignored in scope 19:.:.:xcb-plugin.pro:<TRUE>: +#### Keys ignored in scope 20:.:.:xcb-plugin.pro:<TRUE>: # OTHER_FILES = "xcb.json" "README" ## Scopes: ##################################################################### -#### Keys ignored in scope 21:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 22:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" add_subdirectory(gl_integrations) if(OFF) 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 |