diff options
author | Andy Nichols <andy.nichols@digia.com> | 2013-01-31 15:58:14 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2013-02-06 14:19:35 +0100 |
commit | 4cbc411f60d17a6d4f4e9d4156146537d5dc2f16 (patch) | |
tree | d73b8d890f9e9e56c988f298f47a20370890bfed /src | |
parent | 634c4f6877d63cc30914049989b5cbfd18cd15c3 (diff) |
Overhaul how platform plugins are built
Instead of building only one platform plugin through the use of a
complicated if/else structure, build a plugin for each available
hardware integration type.
Change-Id: If133576515a881274019c1ac5956605f27a9fc40
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/platforms.pro | 25 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/main.cpp (renamed from src/plugins/platforms/wayland/main.cpp) | 6 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.pro | 18 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.cpp) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.h) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h (renamed from src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/main.cpp | 74 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwayland-egl.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwayland-egl.pro | 26 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandeglinclude.h (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-egl/qwaylandglcontext.h (renamed from src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-nogl/main.cpp | 74 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-nogl/qwayland-nogl.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-nogl/qwayland-nogl.pro | 8 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/main.cpp (renamed from src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.h) | 46 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.pro | 25 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/main.cpp | 74 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.pro | 25 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/brcm_egl/brcm_egl.pri | 11 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/gl_integration.pri | 50 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.cpp | 106 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.h | 72 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.cpp | 82 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.h | 71 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.cpp | 106 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_cgl/readback_cgl.pri | 10 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp | 171 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h | 79 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp | 117 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h | 84 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.cpp | 76 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.h | 66 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_egl/readback_egl.pri | 17 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.cpp | 134 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.h | 76 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.cpp | 102 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.h | 81 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp | 114 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h | 73 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/readback_glx/readback_glx.pri | 16 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri | 17 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri | 18 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/gl_integration/xcomposite_glx/xcomposite_glx.pri | 18 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/wayland.json | 3 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandbuffer.h (renamed from src/plugins/platforms/wayland/qwaylandbuffer.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandclipboard.cpp (renamed from src/plugins/platforms/wayland/qwaylandclipboard.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandclipboard.h (renamed from src/plugins/platforms/wayland/qwaylandclipboard.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandcursor.cpp (renamed from src/plugins/platforms/wayland/qwaylandcursor.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandcursor.h (renamed from src/plugins/platforms/wayland/qwaylandcursor.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp (renamed from src/plugins/platforms/wayland/qwaylanddatadevicemanager.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h (renamed from src/plugins/platforms/wayland/qwaylanddatadevicemanager.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp (renamed from src/plugins/platforms/wayland/qwaylanddataoffer.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddataoffer.h (renamed from src/plugins/platforms/wayland/qwaylanddataoffer.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddatasource.cpp (renamed from src/plugins/platforms/wayland/qwaylanddatasource.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddatasource.h (renamed from src/plugins/platforms/wayland/qwaylanddatasource.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddecoration.cpp (renamed from src/plugins/platforms/wayland/qwaylanddecoration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddecoration.h (renamed from src/plugins/platforms/wayland/qwaylanddecoration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddisplay.cpp (renamed from src/plugins/platforms/wayland/qwaylanddisplay.cpp) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddisplay.h (renamed from src/plugins/platforms/wayland/qwaylanddisplay.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddnd.cpp (renamed from src/plugins/platforms/wayland/qwaylanddnd.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylanddnd.h (renamed from src/plugins/platforms/wayland/qwaylanddnd.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp (renamed from src/plugins/platforms/wayland/qwaylandextendedoutput.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandextendedoutput.h (renamed from src/plugins/platforms/wayland/qwaylandextendedoutput.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp (renamed from src/plugins/platforms/wayland/qwaylandextendedsurface.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandextendedsurface.h (renamed from src/plugins/platforms/wayland/qwaylandextendedsurface.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandglintegration.cpp (renamed from src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandglintegration.h (renamed from src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp (renamed from src/plugins/platforms/wayland/qwaylandinputdevice.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandinputdevice.h (renamed from src/plugins/platforms/wayland/qwaylandinputdevice.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandintegration.cpp (renamed from src/plugins/platforms/wayland/qwaylandintegration.cpp) | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandintegration.h (renamed from src/plugins/platforms/wayland/qwaylandintegration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp (renamed from src/plugins/platforms/wayland/qwaylandnativeinterface.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandnativeinterface.h (renamed from src/plugins/platforms/wayland/qwaylandnativeinterface.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandqtkey.cpp (renamed from src/plugins/platforms/wayland/qwaylandqtkey.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandqtkey.h (renamed from src/plugins/platforms/wayland/qwaylandqtkey.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandscreen.cpp (renamed from src/plugins/platforms/wayland/qwaylandscreen.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandscreen.h (renamed from src/plugins/platforms/wayland/qwaylandscreen.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshell.cpp (renamed from src/plugins/platforms/wayland/qwaylandshell.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshell.h (renamed from src/plugins/platforms/wayland/qwaylandshell.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp (renamed from src/plugins/platforms/wayland/qwaylandshellsurface.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshellsurface.h (renamed from src/plugins/platforms/wayland/qwaylandshellsurface.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmbackingstore.cpp (renamed from src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmbackingstore.h (renamed from src/plugins/platforms/wayland/qwaylandshmbackingstore.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp (renamed from src/plugins/platforms/wayland/qwaylandshmdecoration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmdecoration.h (renamed from src/plugins/platforms/wayland/qwaylandshmdecoration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp (renamed from src/plugins/platforms/wayland/qwaylandshmwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandshmwindow.h (renamed from src/plugins/platforms/wayland/qwaylandshmwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp (renamed from src/plugins/platforms/wayland/qwaylandsubsurface.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandsubsurface.h (renamed from src/plugins/platforms/wayland/qwaylandsubsurface.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandtouch.cpp (renamed from src/plugins/platforms/wayland/qwaylandtouch.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandtouch.h (renamed from src/plugins/platforms/wayland/qwaylandtouch.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandwindow.cpp (renamed from src/plugins/platforms/wayland/qwaylandwindow.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/qwaylandwindow.h (renamed from src/plugins/platforms/wayland/qwaylandwindow.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/wayland_common.pri | 27 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/wayland_common.pro (renamed from src/plugins/platforms/wayland/wayland.pro) | 66 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp (renamed from src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h (renamed from src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/wayland_common/windowmanager_integration/windowmanager_integration.pri (renamed from src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.cpp) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.h) | 0 | ||||
-rw-r--r-- | src/plugins/platforms/xcomposite_share/xcomposite_share.pri (renamed from src/plugins/platforms/wayland/gl_integration/xcomposite_share/xcomposite_share.pri) | 2 |
126 files changed, 454 insertions, 1843 deletions
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index b912e2554..167602901 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -1,2 +1,25 @@ TEMPLATE=subdirs -SUBDIRS += wayland +CONFIG+=ordered +SUBDIRS += wayland_common + +equals(QT_WAYLAND_GL_CONFIG, nogl) { + SUBDIRS += qwayland-nogl +} else { + config_wayland_egl { + SUBDIRS += qwayland-egl + } + + #The following integrations are only useful with QtCompositor + contains(CONFIG, wayland-compositor) { + config_brcm_egl { + SUBDIRS += qwayland-brcm-egl + } + config_xcomposite { + config_egl { + SUBDIRS += qwayland-xcomposite-egl + } else:config_glx { + SUBDIRS += qwayland-xcomposite-glx + } + } + } +} diff --git a/src/plugins/platforms/wayland/main.cpp b/src/plugins/platforms/qwayland-brcm-egl/main.cpp index ffd2bced1..9862223f7 100644 --- a/src/plugins/platforms/wayland/main.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/main.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE class QWaylandIntegrationPlugin : public QPlatformIntegrationPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "wayland.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "qwayland-brcm-egl.json") public: QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); @@ -56,14 +56,14 @@ public: QStringList QWaylandIntegrationPlugin::keys() const { QStringList list; - list << "wayland"; + list << "wayland-brcm"; return list; } QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); - if (system.toLower() == "wayland") + if (system.toLower() == "wayland-brcm") return new QWaylandIntegration(); return 0; diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.json b/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.json new file mode 100644 index 000000000..48611c6ab --- /dev/null +++ b/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-brcm" ] +} diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.pro b/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.pro new file mode 100644 index 000000000..1f7a9c269 --- /dev/null +++ b/src/plugins/platforms/qwayland-brcm-egl/qwayland-brcm-egl.pro @@ -0,0 +1,18 @@ +PLUGIN_TYPE = platforms +load(qt_plugin) + +include(../wayland_common/wayland_common.pri) + +OTHER_FILES += \ + qwayland-brcm-egl.json + +SOURCES += qwaylandbrcmeglintegration.cpp \ + qwaylandbrcmglcontext.cpp \ + qwaylandbrcmeglwindow.cpp \ + main.cpp + +HEADERS += qwaylandbrcmeglintegration.h \ + qwaylandbrcmglcontext.h \ + qwaylandbrcmeglwindow.h + +WAYLANDSOURCES += ../../../extensions/brcm.xml diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp index d107d5a8f..a1d6df082 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp @@ -41,7 +41,7 @@ #include "qwaylandbrcmeglintegration.h" -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include "qwaylandbrcmeglwindow.h" #include "qwaylandbrcmglcontext.h" diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h index c3874259d..de7b38a52 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglintegration.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDBRCMEGLINTEGRATION_H #define QWAYLANDBRCMEGLINTEGRATION_H -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include <EGL/egl.h> #include <EGL/eglext.h> diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp index 82f673922..82f673922 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h index 92c0aa57e..92c0aa57e 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmeglwindow.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp index a3b737f55..a3b737f55 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h index ae248a6ad..ae248a6ad 100644 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/qwaylandbrcmglcontext.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h diff --git a/src/plugins/platforms/qwayland-egl/main.cpp b/src/plugins/platforms/qwayland-egl/main.cpp new file mode 100644 index 000000000..222cc1e85 --- /dev/null +++ b/src/plugins/platforms/qwayland-egl/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qpa/qplatformintegrationplugin.h> +#include "qwaylandintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QPlatformIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "qwayland-egl.json") +public: + QStringList keys() const; + QPlatformIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland" << "wayland-egl"; + return list; +} + +QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland" || system.toLower() == "wayland-egl") + return new QWaylandIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/platforms/qwayland-egl/qwayland-egl.json b/src/plugins/platforms/qwayland-egl/qwayland-egl.json new file mode 100644 index 000000000..3ab70d3c3 --- /dev/null +++ b/src/plugins/platforms/qwayland-egl/qwayland-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland", "wayland-egl" ] +} diff --git a/src/plugins/platforms/qwayland-egl/qwayland-egl.pro b/src/plugins/platforms/qwayland-egl/qwayland-egl.pro new file mode 100644 index 000000000..cdebf9bbc --- /dev/null +++ b/src/plugins/platforms/qwayland-egl/qwayland-egl.pro @@ -0,0 +1,26 @@ +PLUGIN_TYPE = platforms +load(qt_plugin) + +include(../wayland_common/wayland_common.pri) + +OTHER_FILES += \ + qwayland-egl.json + +!contains(QT_CONFIG, no-pkg-config) { + CONFIG += link_pkgconfig + PKGCONFIG += wayland-egl egl +} else { + LIBS += -lwayland-egl -lEGL +} + +SOURCES += qwaylandeglintegration.cpp \ + qwaylandglcontext.cpp \ + qwaylandeglwindow.cpp \ + qwaylandegldecoration.cpp \ + main.cpp + +HEADERS += qwaylandeglintegration.h \ + qwaylandglcontext.h \ + qwaylandeglwindow.h \ + qwaylandegldecoration.h \ + qwaylandeglinclude.h diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.cpp b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp index 5cf5239a8..5cf5239a8 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.h b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h index c1ef6d54a..c1ef6d54a 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandegldecoration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h b/src/plugins/platforms/qwayland-egl/qwaylandeglinclude.h index fb42d43c1..fb42d43c1 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglinclude.h diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp index b0a426704..b64798f66 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp @@ -41,7 +41,7 @@ #include "qwaylandeglintegration.h" -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include "qwaylandeglwindow.h" #include "qwaylandglcontext.h" diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h index d154c7ee4..77a365dfa 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDEGLINTEGRATION_H #define QWAYLANDEGLINTEGRATION_H -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include "qwaylandeglinclude.h" diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp index caed3dfe0..caed3dfe0 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h index 4a7b3054a..4a7b3054a 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp index f9ad280f7..f9ad280f7 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h index 767f188fb..767f188fb 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h diff --git a/src/plugins/platforms/qwayland-nogl/main.cpp b/src/plugins/platforms/qwayland-nogl/main.cpp new file mode 100644 index 000000000..606939020 --- /dev/null +++ b/src/plugins/platforms/qwayland-nogl/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qpa/qplatformintegrationplugin.h> +#include "qwaylandintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QPlatformIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "qwayland-nogl.json") +public: + QStringList keys() const; + QPlatformIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland" << "wayland-nogl"; + return list; +} + +QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland" || system.toLower() == "wayland-nogl") + return new QWaylandIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/platforms/qwayland-nogl/qwayland-nogl.json b/src/plugins/platforms/qwayland-nogl/qwayland-nogl.json new file mode 100644 index 000000000..8cbc863f9 --- /dev/null +++ b/src/plugins/platforms/qwayland-nogl/qwayland-nogl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland", "wayland-nogl" ] +} diff --git a/src/plugins/platforms/qwayland-nogl/qwayland-nogl.pro b/src/plugins/platforms/qwayland-nogl/qwayland-nogl.pro new file mode 100644 index 000000000..cb3b86eb5 --- /dev/null +++ b/src/plugins/platforms/qwayland-nogl/qwayland-nogl.pro @@ -0,0 +1,8 @@ +PLUGIN_TYPE = platforms +load(qt_plugin) + +include(../wayland_common/wayland_common.pri) + +OTHER_FILES += qwayland-nogl.json + +SOURCES += main.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.h b/src/plugins/platforms/qwayland-xcomposite-egl/main.cpp index 0a6850638..414830ffa 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/main.cpp @@ -39,32 +39,36 @@ ** ****************************************************************************/ -#ifndef QWAYLANDREADBACKGLXWINDOW_H -#define QWAYLANDREADBACKGLXWINDOW_H +#include <qpa/qplatformintegrationplugin.h> +#include "qwaylandintegration.h" -#include "qwaylandshmwindow.h" -#include "qwaylandreadbackcglintegration.h" -#include "qwaylandreadbackcglcontext.h" +QT_BEGIN_NAMESPACE -#include <OpenGL/OpenGL.h> - -class QWaylandReadbackCGLWindow : public QWaylandShmWindow +class QWaylandIntegrationPlugin : public QPlatformIntegrationPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "qwayland-xcomposite-egl.json") public: - QWaylandReadbackCGLWindow(QWindow *window, QWaylandReadbackCGLIntegration *cglIntegration); - WindowType windowType() const; + QStringList keys() const; + QPlatformIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-xcomposite"; + return list; +} - void setGeometry(const QRect &rect); - CGLPBufferObj pixelBuffer(); - uchar *buffer(); -private: - void createSurface(); +QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-xcomposite") + return new QWaylandIntegration(); - QWaylandReadbackCGLIntegration *m_CglIntegration; - QWaylandReadbackCGLContext *mContext; + return 0; +} - QWaylandShmBuffer *m_buffer; - CGLPBufferObj m_pixelBuffer; -}; +QT_END_NAMESPACE -#endif // QWAYLANDREADBACKGLXWINDOW_H +#include "main.moc" diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json b/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json new file mode 100644 index 000000000..8ccd5b46b --- /dev/null +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-xcomposite" ] +} diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.pro b/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.pro new file mode 100644 index 000000000..b691ec9dc --- /dev/null +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwayland-xcomposite-egl.pro @@ -0,0 +1,25 @@ +PLUGIN_TYPE = platforms +load(qt_plugin) + +include(../wayland_common/wayland_common.pri) +include (../xcomposite_share/xcomposite_share.pri) + +OTHER_FILES += qwayland-xcomposite-egl.json + +!contains(QT_CONFIG, no-pkg-config) { + CONFIG += link_pkgconfig + PKGCONFIG += xcomposite egl x11 +} else { + LIBS += -lXcomposite -lEGL -lX11 +} + +SOURCES += \ + qwaylandxcompositeeglcontext.cpp \ + qwaylandxcompositeeglintegration.cpp \ + qwaylandxcompositeeglwindow.cpp \ + main.cpp + +HEADERS += \ + qwaylandxcompositeeglcontext.h \ + qwaylandxcompositeeglintegration.h \ + qwaylandxcompositeeglwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp index 5024ba25d..5024ba25d 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h index 906f8a3f5..906f8a3f5 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp index c4d98a8ea..c4d98a8ea 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h index cfa9fe5cb..ae0fc30bc 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDXCOMPOSITEEGLINTEGRATION_H #define QWAYLANDXCOMPOSITEEGLINTEGRATION_H -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include "wayland-client.h" #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp index 0f50f63f1..0f50f63f1 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h index ac7419a9f..ac7419a9f 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp new file mode 100644 index 000000000..d442c8193 --- /dev/null +++ b/src/plugins/platforms/qwayland-xcomposite-glx/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qpa/qplatformintegrationplugin.h> +#include "qwaylandintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QPlatformIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.1" FILE "qwayland-xcomposite-glx.json") +public: + QStringList keys() const; + QPlatformIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-xcomposite"; + return list; +} + +QPlatformIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-xcomposite") + return new QWaylandIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json b/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json new file mode 100644 index 000000000..8ccd5b46b --- /dev/null +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-xcomposite" ] +} diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.pro b/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.pro new file mode 100644 index 000000000..6d7041085 --- /dev/null +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwayland-xcomposite-glx.pro @@ -0,0 +1,25 @@ +PLUGIN_TYPE = platforms +load(qt_plugin) + +include(../wayland_common/wayland_common.pri) +include (../xcomposite_share/xcomposite_share.pri) + +OTHER_FILES += qwayland-xcomposite-glx.json + +!contains(QT_CONFIG, no-pkg-config) { + CONFIG += link_pkgconfig + PKGCONFIG += xcomposite gl x11 +} else { + LIBS += -lXcomposite -lGL -lX11 +} + +SOURCES += \ + qwaylandxcompositeglxcontext.cpp \ + qwaylandxcompositeglxintegration.cpp \ + qwaylandxcompositeglxwindow.cpp \ + main.cpp + +HEADERS += \ + qwaylandxcompositeglxcontext.h \ + qwaylandxcompositeglxintegration.h \ + qwaylandxcompositeglxwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp index 4ba499255..4ba499255 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h index 55b6c2aff..55b6c2aff 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp index d82c6456c..d82c6456c 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h index 904cec8f5..3417967c2 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h @@ -42,7 +42,7 @@ #ifndef QWAYLANDXCOMPOSITEGLXINTEGRATION_H #define QWAYLANDXCOMPOSITEGLXINTEGRATION_H -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #include "wayland-client.h" #include <QtCore/QTextStream> diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp index ad1916b3b..ad1916b3b 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h index 6c19ee498..6c19ee498 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/brcm_egl/brcm_egl.pri b/src/plugins/platforms/wayland/gl_integration/brcm_egl/brcm_egl.pri deleted file mode 100644 index 81b9be0f1..000000000 --- a/src/plugins/platforms/wayland/gl_integration/brcm_egl/brcm_egl.pri +++ /dev/null @@ -1,11 +0,0 @@ -LIBS += -lEGL -lGLESv2 -INCLUDEPATH += $$PWD -SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \ - $$PWD/qwaylandbrcmglcontext.cpp \ - $$PWD/qwaylandbrcmeglwindow.cpp - -HEADERS += $$PWD/qwaylandbrcmeglintegration.h \ - $$PWD/qwaylandbrcmglcontext.h \ - $$PWD/qwaylandbrcmeglwindow.h - -WAYLANDSOURCES += $$PWD/../../../../../extensions/brcm.xml diff --git a/src/plugins/platforms/wayland/gl_integration/gl_integration.pri b/src/plugins/platforms/wayland/gl_integration/gl_integration.pri deleted file mode 100644 index 5fc7c4302..000000000 --- a/src/plugins/platforms/wayland/gl_integration/gl_integration.pri +++ /dev/null @@ -1,50 +0,0 @@ -isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG) -contains(QT_CONFIG, opengl):!equals(QT_WAYLAND_GL_CONFIG, nogl) { - - DEFINES += QT_WAYLAND_GL_SUPPORT - - HEADERS += \ - $$PWD/qwaylandglintegration.h - - SOURCES += \ - $$PWD/qwaylandglintegration.cpp - - equals(QT_WAYLAND_GL_CONFIG, brcm_egl) { - CONFIG -= config_wayland_egl config_xcomposite - } - - equals(QT_WAYLAND_GL_CONFIG, xcomposite) { - CONFIG -= config_wayland_egl config_brcm_egl - } - - config_wayland_egl { - include ($$PWD/wayland_egl/wayland_egl.pri) - QT_WAYLAND_GL_INTEGRATION = wayland_egl - }else:config_brcm_egl { - include ($$PWD/brcm_egl/brcm_egl.pri) - QT_WAYLAND_GL_INTEGRATION = brcm_egl - }else:config_xcomposite { - config_egl { - include ($$PWD/xcomposite_egl/xcomposite_egl.pri) - QT_WAYLAND_GL_INTEGRATION = xcomposite_egl - }else:config_glx { - include ($$PWD/xcomposite_glx/xcomposite_glx.pri) - QT_WAYLAND_GL_INTEGRATION = xcomposite_glx - } - }else:mac { - include ($$PWD/readback_cgl/readback_cgl.pri) - QT_WAYLAND_GL_INTEGRATION = readback_cgl - }else { - config_egl { - include ($$PWD/readback_egl/readback_egl.pri) - QT_WAYLAND_GL_INTEGRATION = readback_egl - }else:config_glx { - include ($$PWD/readback_glx/readback_glx.pri) - QT_WAYLAND_GL_INTEGRATION = readback_glx - } - } - - system(echo "Qt Wayland plugin configured with openGL integration: $$QT_WAYLAND_GL_INTEGRATION") - -} - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.cpp deleted file mode 100644 index 8000c4a1c..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackcglcontext.h" - -#include "qwaylandshmbackingstore.h" -#include "qwaylandreadbackcglwindow.h" - -#include <QtGui/QOpenGLContext> -#include <QtCore/QDebug> - -#include <OpenGL/OpenGL.h> -#include <OpenGL/glext.h> -#include <OpenGL/glu.h> - -#include <QtPlatformSupport/private/cglconvenience_p.h> - -QWaylandReadbackCGLContext::QWaylandReadbackCGLContext(QPlatformOpenGLContext *share) - : QPlatformOpenGLContext() -{ - Q_UNUSED(share); - m_glContext = qcgl_createGlContext(); -} - -QSurfaceFormat QWaylandReadbackCGLContext::format() const -{ - return qcgl_surfaceFormat(); -} - -bool QWaylandReadbackCGLContext::makeCurrent(QPlatformSurface *surface) -{ - QWaylandReadbackCGLWindow *window = static_cast<QWaylandReadbackCGLWindow *>(surface); - CGLSetPBuffer(m_glContext, window->pixelBuffer(), 0, 0, 0); - CGLSetCurrentContext(m_glContext); - return true; -} - -void QWaylandReadbackCGLContext::doneCurrent() -{ - CGLSetCurrentContext(0); -} - -void QWaylandReadbackCGLContext::swapBuffers(QPlatformSurface *surface) -{ - Q_UNUSED(surface); - - if (QOpenGLContext::currentContext()->handle() != this) { - makeCurrent(surface); - } - CGLFlushDrawable(m_glContext); - - QWaylandReadbackCGLWindow *window = static_cast<QWaylandReadbackCGLWindow *>(surface); - QSize size = window->geometry().size(); - - uchar *dstBits = const_cast<uchar *>(window->buffer()); - glReadPixels(0,0, size.width(), size.height(), GL_BGRA,GL_UNSIGNED_BYTE, dstBits); - - window->damage(QRect(QPoint(0,0),size)); - - // ### Should sync here but this call deadlocks with the server. - //window->waitForFrameSync(); -} - -void (*QWaylandReadbackCGLContext::getProcAddress(const QByteArray &procName)) () -{ - return qcgl_getProcAddress(procName); -} - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.h b/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.h deleted file mode 100644 index 91338e275..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglcontext.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKCGLCONTEXT_H -#define QWAYLANDREADBACKCGLCONTEXT_H - -#include <qpa/qplatformopenglcontext.h> - -#include "qwaylandreadbackcglintegration.h" - -#include <OpenGL/OpenGL.h> - -class QWaylandReadbackCGLWindow; -class QWaylandShmBuffer; - -class QWaylandReadbackCGLContext : public QPlatformOpenGLContext -{ -public: - QWaylandReadbackCGLContext(QPlatformOpenGLContext *share); - - QSurfaceFormat format() const; - - bool makeCurrent(QPlatformSurface *surface); - void doneCurrent(); - void swapBuffers(QPlatformSurface *surface); - void (*getProcAddress(const QByteArray &procName)) (); - - void geometryChanged(); - -private: - CGLContextObj m_glContext; -}; - -#endif // QWAYLANDREADBACKCGLCONTEXT_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.cpp deleted file mode 100644 index 62318ee91..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackcglintegration.h" -#include "qwaylandreadbackcglcontext.h" -#include "qwaylandreadbackcglwindow.h" - -#include <QtCore/QDebug> - -QWaylandGLIntegration * QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) -{ - return new QWaylandReadbackCGLIntegration(waylandDisplay); -} - -QWaylandReadbackCGLIntegration::QWaylandReadbackCGLIntegration(QWaylandDisplay * waylandDispaly) - : QWaylandGLIntegration() - , mWaylandDisplay(waylandDispaly) -{ - qDebug() << "Using Readback-CGL"; -} - -QWaylandReadbackCGLIntegration::~QWaylandReadbackCGLIntegration() -{ - -} - -void QWaylandReadbackCGLIntegration::initialize() -{ -} - -QWaylandWindow * QWaylandReadbackCGLIntegration::createEglWindow(QWindow *window) -{ - return new QWaylandReadbackCGLWindow(window,this); -} - -QPlatformOpenGLContext *QWaylandReadbackCGLIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const -{ - return new QWaylandReadbackCGLContext(share); -} - -QWaylandDisplay * QWaylandReadbackCGLIntegration::waylandDisplay() const -{ - return mWaylandDisplay; -} diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.h b/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.h deleted file mode 100644 index 676405e18..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglintegration.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKGLXINTEGRATION_H -#define QWAYLANDREADBACKGLXINTEGRATION_H - -#include "gl_integration/qwaylandglintegration.h" - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtGui/QWindow> - -#include <X11/Xlib.h> - -class QWaylandReadbackCGLIntegration : public QWaylandGLIntegration -{ -public: - QWaylandReadbackCGLIntegration(QWaylandDisplay * waylandDispaly); - ~QWaylandReadbackCGLIntegration(); - - void initialize(); - - QWaylandWindow *createEglWindow(QWindow *window); - QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const; - QWaylandDisplay *waylandDisplay() const; - -private: - QWaylandDisplay *mWaylandDisplay; -}; - -#endif // QWAYLANDREADBACKGLXINTEGRATION_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.cpp deleted file mode 100644 index 803b3b017..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/qwaylandreadbackcglwindow.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackcglwindow.h" -#include "qwaylandshmbackingstore.h" - -#include <OpenGL/OpenGL.h> -#include <OpenGL/glext.h> - -QWaylandReadbackCGLWindow::QWaylandReadbackCGLWindow(QWindow *window, QWaylandReadbackCGLIntegration *cglIntegration) - : QWaylandShmWindow(window) - , m_CglIntegration(cglIntegration) - , mContext(0) - , m_buffer(0) - , m_pixelBuffer(0) -{ -} - -QWaylandWindow::WindowType QWaylandReadbackCGLWindow::windowType() const -{ - //yeah. this type needs a new name - return QWaylandWindow::Egl; -} - - -void QWaylandReadbackCGLWindow::setGeometry(const QRect &rect) -{ - QWaylandShmWindow::setGeometry(rect); - - if (m_buffer) { - delete m_buffer; - m_buffer = 0; - - CGLDestroyPBuffer(m_pixelBuffer); - m_pixelBuffer = 0; - } -} - -CGLPBufferObj QWaylandReadbackCGLWindow::pixelBuffer() -{ - if (!m_pixelBuffer) - createSurface(); - - return m_pixelBuffer; -} - -uchar *QWaylandReadbackCGLWindow::buffer() -{ - return m_buffer->image()->bits(); -} - -void QWaylandReadbackCGLWindow::createSurface() -{ - QSize size(geometry().size()); - if (size.isEmpty()) { - //QGLWidget wants a context for a window without geometry - size = QSize(1,1); - } - - waitForFrameSync(); - - CGLCreatePBuffer(size.width(), size.height(), GL_TEXTURE_RECTANGLE_ARB, GL_BGRA, 0, &m_pixelBuffer); - - delete m_buffer; - m_buffer = new QWaylandShmBuffer(m_CglIntegration->waylandDisplay(),size,QImage::Format_ARGB32); - attach(m_buffer, 0, 0); -} - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_cgl/readback_cgl.pri b/src/plugins/platforms/wayland/gl_integration/readback_cgl/readback_cgl.pri deleted file mode 100644 index 91cb90a30..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_cgl/readback_cgl.pri +++ /dev/null @@ -1,10 +0,0 @@ -HEADERS += \ - $$PWD/qwaylandreadbackcglintegration.h \ - $$PWD/qwaylandreadbackcglwindow.h \ - $$PWD/qwaylandreadbackcglcontext.h - -SOURCES += \ - $$PWD/qwaylandreadbackcglintegration.cpp \ - $$PWD/qwaylandreadbackcglwindow.cpp \ - $$PWD/qwaylandreadbackcglcontext.cpp - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp deleted file mode 100644 index 7c288625e..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackeglcontext.h" - -#include <qpa/qplatformsupport/eglconvenience/qeglconvenience_p.h.h> - -#include <QtCore/QDebug> -#include <QtGui/QWindowContext> - -#include "qwaylandshmsurface.h" - - -static inline void qgl_byteSwapImage(QImage &img, GLenum pixel_type) -{ - const int width = img.width(); - const int height = img.height(); - - if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV - || (pixel_type == GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) - { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); - } - } else { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = (p[x] << 8) | ((p[x] >> 24) & 0xff); - } - } -} - -QWaylandReadbackEglContext::QWaylandReadbackEglContext(QWaylandReadbackEglIntegration *eglIntegration, QWaylandReadbackEglWindow *window) - : mEglIntegration(eglIntegration) - , mWindow(window) - , mBuffer(0) - , mPixmap(0) - , mConfig(q_configFromQWindowFormat(eglIntegration->eglDisplay(),window->window()->requestedWindowFormat(),true,EGL_PIXMAP_BIT)) - , mPixmapSurface(EGL_NO_SURFACE) -{ - QVector<EGLint> eglContextAttrs; - eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); - eglContextAttrs.append(2); - eglContextAttrs.append(EGL_NONE); - - mContext = eglCreateContext(eglIntegration->eglDisplay(),mConfig,0,eglContextAttrs.constData()); - - geometryChanged(); -} - -QWaylandReadbackEglContext::~QWaylandReadbackEglContext() -{ - eglDestroyContext(mEglIntegration->eglDisplay(),mContext); -} - -void QWaylandReadbackEglContext::makeCurrent() -{ - mWindow->waitForFrameSync(); - - eglMakeCurrent(mEglIntegration->eglDisplay(),mPixmapSurface,mPixmapSurface,mContext); -} - -void QWaylandReadbackEglContext::doneCurrent() -{ - QPlatformOpenGLContext::doneCurrent(); - eglMakeCurrent(mEglIntegration->eglDisplay(),EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT); -} - -void QWaylandReadbackEglContext::swapBuffers() -{ - eglSwapBuffers(mEglIntegration->eglDisplay(),mPixmapSurface); - - if (QWindowContext::currentContext()->handle() != this) { - makeCurrent(); - } - - QSize size = mWindow->geometry().size(); - - QImage img(size,QImage::Format_ARGB32); - const uchar *constBits = img.bits(); - void *pixels = const_cast<uchar *>(constBits); - - glReadPixels(0,0, size.width(), size.height(), GL_RGBA,GL_UNSIGNED_BYTE, pixels); - - img = img.mirrored(); - qgl_byteSwapImage(img,GL_UNSIGNED_INT_8_8_8_8_REV); - constBits = img.bits(); - - const uchar *constDstBits = mBuffer->image()->bits(); - uchar *dstBits = const_cast<uchar *>(constDstBits); - memcpy(dstBits,constBits,(img.width()*4) * img.height()); - - - mWindow->damage(QRegion(QRect(QPoint(0,0),size))); -} - -void * QWaylandReadbackEglContext::getProcAddress(const QString &procName) -{ - return (void *) eglGetProcAddress(procName.toLatin1().data()); -} - -QWindowFormat QWaylandReadbackEglContext::windowFormat() const -{ - return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig); -} - -void QWaylandReadbackEglContext::geometryChanged() -{ - QSize size(mWindow->geometry().size()); - if (size.isEmpty()) { - //QGLWidget wants a context for a window without geometry - size = QSize(1,1); - } - - mWindow->waitForFrameSync(); - - delete mBuffer; - if (mPixmap) - XFreePixmap(mEglIntegration->xDisplay(),mPixmap); - - mBuffer = new QWaylandShmBuffer(mEglIntegration->waylandDisplay(),size,QImage::Format_ARGB32); - mWindow->attach(mBuffer, 0, 0); - mPixmap = XCreatePixmap(mEglIntegration->xDisplay(),mEglIntegration->rootWindow(),size.width(),size.height(),mEglIntegration->depth()); - XSync(mEglIntegration->xDisplay(),False); - - mPixmapSurface = eglCreatePixmapSurface(mEglIntegration->eglDisplay(),mConfig,mPixmap,0); - if (mPixmapSurface == EGL_NO_SURFACE) { - qDebug() << "Could not make egl surface out of pixmap :("; - } -} diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h deleted file mode 100644 index adedba059..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKEGLGLCONTEXT_H -#define QWAYLANDREADBACKEGLGLCONTEXT_H - -#include <qpa/qplatformopenglcontext.h> - -#include "qwaylandreadbackeglintegration.h" -#include "qwaylandreadbackeglwindow.h" - -class QWaylandShmBuffer; - -class QWaylandReadbackEglContext : public QPlatformOpenGLContext -{ -public: - QWaylandReadbackEglContext(QWaylandReadbackEglIntegration *eglIntegration, QWaylandReadbackEglWindow *window); - ~QWaylandReadbackEglContext(); - - void makeCurrent(); - void doneCurrent(); - void swapBuffers(); - void* getProcAddress(const QString& procName); - - virtual QWindowFormat windowFormat() const; - - void geometryChanged(); - -private: - QWaylandReadbackEglIntegration *mEglIntegration; - QWaylandReadbackEglWindow *mWindow; - QWaylandShmBuffer *mBuffer; - - Pixmap mPixmap; - - EGLConfig mConfig; - EGLContext mContext; - EGLSurface mPixmapSurface; -}; - -#endif // QWAYLANDREADBACKEGLGLCONTEXT_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp deleted file mode 100644 index 140997d71..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackeglintegration.h" - -#include <QDebug> - -#include "qwaylandreadbackeglwindow.h" - -QWaylandReadbackEglIntegration::QWaylandReadbackEglIntegration(QWaylandDisplay *display) - : QWaylandGLIntegration() - , mWaylandDisplay(display) -{ - qDebug() << "Using Readback-EGL"; - char *display_name = getenv("DISPLAY"); - mDisplay = XOpenDisplay(display_name); - mScreen = XDefaultScreen(mDisplay); - mRootWindow = XDefaultRootWindow(mDisplay); - XSync(mDisplay, False); -} - -QWaylandReadbackEglIntegration::~QWaylandReadbackEglIntegration() -{ - XCloseDisplay(mDisplay); -} - - -QWaylandGLIntegration *QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) -{ - return new QWaylandReadbackEglIntegration(waylandDisplay); -} - -void QWaylandReadbackEglIntegration::initialize() -{ - eglBindAPI(EGL_OPENGL_ES_API); - mEglDisplay = eglGetDisplay(mDisplay); - EGLint major, minor; - EGLBoolean initialized = eglInitialize(mEglDisplay,&major,&minor); - if (initialized) { - qDebug() << "EGL initialized successfully" << major << "," << minor; - } else { - qDebug() << "EGL could not initialized. All EGL and GL operations will fail"; - } -} - -QWaylandWindow * QWaylandReadbackEglIntegration::createEglWindow(QWindow *window) -{ - return new QWaylandReadbackEglWindow(window, this); -} - -QPlatformOpenGLContext *QWaylandReadbackEglWindow::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const -{ - return new QWaylandReadbackEglContext(glFormat, share, this); -} - -EGLDisplay QWaylandReadbackEglIntegration::eglDisplay() -{ - return mEglDisplay; -} - -Window QWaylandReadbackEglIntegration::rootWindow() const -{ - return mRootWindow; -} - -int QWaylandReadbackEglIntegration::depth() const -{ - return XDefaultDepth(mDisplay,mScreen); -} - -Display * QWaylandReadbackEglIntegration::xDisplay() const -{ - return mDisplay; -} - -QWaylandDisplay * QWaylandReadbackEglIntegration::waylandDisplay() const -{ - return mWaylandDisplay; -} diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h deleted file mode 100644 index c1f47ed14..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKEGLINTEGRATION_H -#define QWAYLANDREADBACKEGLINTEGRATION_H - -#include "gl_integration/qwaylandglintegration.h" - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtCore/QEvent> -#include <QtGui/QCursor> - -#include <X11/Xlib.h> - -#include <EGL/egl.h> - -class QWaylandReadbackEglIntegration : public QWaylandGLIntegration -{ -public: - QWaylandReadbackEglIntegration(QWaylandDisplay *display); - ~QWaylandReadbackEglIntegration(); - - void initialize(); - QWaylandWindow *createEglWindow(QWindow *window); - QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const; - - QWaylandDisplay *waylandDisplay() const; - Display *xDisplay() const; - Window rootWindow() const; - int depth() const; - - EGLDisplay eglDisplay(); - -private: - QWaylandDisplay *mWaylandDisplay; - Display *mDisplay; - int mScreen; - Window mRootWindow; - EGLDisplay mEglDisplay; - -}; - -#endif // QWAYLANDREADBACKEGLINTEGRATION_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.cpp deleted file mode 100644 index bbfc34d57..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackeglwindow.h" - -#include "qwaylandreadbackeglcontext.h" - -QWaylandReadbackEglWindow::QWaylandReadbackEglWindow(QWindow *window, QWaylandReadbackEglIntegration *eglIntegration) - : QWaylandShmWindow(window) - , mEglIntegration(eglIntegration) - , mContext(0) -{ -} - -QWaylandWindow::WindowType QWaylandReadbackEglWindow::windowType() const -{ - //We'r lying, maybe we should add a type, but for now it will do - //since this is primarly used by the windowsurface. - return QWaylandWindow::Egl; -} - -QPlatformOpenGLContext *QWaylandReadbackEglWindow::glContext() const -{ - if (!mContext) { - QWaylandReadbackEglWindow *that = const_cast<QWaylandReadbackEglWindow *>(this); - that->mContext = new QWaylandReadbackEglContext(mEglIntegration,that); - } - return mContext; -} - -void QWaylandReadbackEglWindow::setGeometry(const QRect &rect) -{ - QPlatformWindow::setGeometry(rect); - - if (mContext) - mContext->geometryChanged(); -} - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.h deleted file mode 100644 index 413840ad0..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglwindow.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKEGLWINDOW_H -#define QWAYLANDREADBACKEGLWINDOW_H - -#include "qwaylandshmwindow.h" -#include "qwaylandreadbackeglintegration.h" - -class QWaylandReadbackEglContext; - -class QWaylandReadbackEglWindow : public QWaylandShmWindow -{ -public: - QWaylandReadbackEglWindow(QWindow *window, QWaylandReadbackEglIntegration *eglIntegration); - - WindowType windowType() const; - - QPlatformOpenGLContext *glContext() const; - - void setGeometry(const QRect &rect); - -private: - QWaylandReadbackEglIntegration *mEglIntegration; - QWaylandReadbackEglContext *mContext; -}; - -#endif // QWAYLANDREADBACKEGLWINDOW_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/readback_egl.pri b/src/plugins/platforms/wayland/gl_integration/readback_egl/readback_egl.pri deleted file mode 100644 index 51890ffdc..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/readback_egl.pri +++ /dev/null @@ -1,17 +0,0 @@ -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += egl x11 xext -} else { - LIBS += -lX11 -lXext -lEGL -} - -load(qpa/egl/convenience) -HEADERS += \ - $$PWD/qwaylandreadbackeglintegration.h \ - $$PWD/qwaylandreadbackeglcontext.h \ - $$PWD/qwaylandreadbackeglwindow.h \ - -SOURCES += \ - $$PWD/qwaylandreadbackeglintegration.cpp \ - $$PWD/qwaylandreadbackeglwindow.cpp \ - $$PWD/qwaylandreadbackeglcontext.cpp \ diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.cpp deleted file mode 100644 index 937e78822..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackglxcontext.h" - -#include "qwaylandshmbackingstore.h" -#include "qwaylandreadbackglxwindow.h" - -#include <QtGui/QOpenGLContext> -#include <QtCore/QDebug> - -static inline void qgl_byteSwapImage(QImage &img, GLenum pixel_type) -{ - const int width = img.width(); - const int height = img.height(); - - if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV - || (pixel_type == GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) - { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); - } - } else { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = (p[x] << 8) | ((p[x] >> 24) & 0xff); - } - } -} - -QWaylandReadbackGlxContext::QWaylandReadbackGlxContext(const QSurfaceFormat &format, - QPlatformOpenGLContext *share, Display *display, int screen) - : m_display(display) -{ - GLXFBConfig config = qglx_findConfig(display, screen, format, GLX_PIXMAP_BIT); - - GLXContext shareContext = share ? static_cast<QWaylandReadbackGlxContext *>(share)->m_context : 0; - - XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display, config); - m_context = glXCreateContext(display, visualInfo, shareContext, TRUE); - m_format = qglx_surfaceFormatFromGLXFBConfig(display, config, m_context); -} - -QSurfaceFormat QWaylandReadbackGlxContext::format() const -{ - return m_format; -} - -bool QWaylandReadbackGlxContext::makeCurrent(QPlatformSurface *surface) -{ - GLXPixmap glxPixmap = static_cast<QWaylandReadbackGlxWindow *>(surface)->glxPixmap(); - - return glXMakeCurrent(m_display, glxPixmap, m_context); -} - -void QWaylandReadbackGlxContext::doneCurrent() -{ - glXMakeCurrent(m_display, 0, 0); -} - -void QWaylandReadbackGlxContext::swapBuffers(QPlatformSurface *surface) -{ - // #### makeCurrent() directly on the platform context doesn't update QOpenGLContext::currentContext() - if (QOpenGLContext::currentContext()->handle() != this) - makeCurrent(surface); - - QWaylandReadbackGlxWindow *w = static_cast<QWaylandReadbackGlxWindow *>(surface); - - QSize size = w->geometry().size(); - - QImage img(size, QImage::Format_ARGB32); - const uchar *constBits = img.bits(); - void *pixels = const_cast<uchar *>(constBits); - - glReadPixels(0, 0, size.width(), size.height(), GL_RGBA,GL_UNSIGNED_BYTE, pixels); - - img = img.mirrored(); - qgl_byteSwapImage(img, GL_UNSIGNED_INT_8_8_8_8_REV); - constBits = img.bits(); - - const uchar *constDstBits = w->buffer(); - uchar *dstBits = const_cast<uchar *>(constDstBits); - memcpy(dstBits, constBits, (img.width() * 4) * img.height()); - - w->damage(QRect(QPoint(), size)); - - w->waitForFrameSync(); -} - -void (*QWaylandReadbackGlxContext::getProcAddress(const QByteArray &procName)) () -{ - return glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName.constData())); -} diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.h b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.h deleted file mode 100644 index 3ce2ac22a..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxcontext.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKGLXCONTEXT_H -#define QWAYLANDREADBACKGLXCONTEXT_H - -#include <qpa/qplatformopenglcontext.h> -#include <QSurfaceFormat> - -#include "qwaylandreadbackglxintegration.h" - -#include <QtPlatformSupport/private/qglxconvenience_p.h> - -class QWaylandReadbackGlxWindow; -class QWaylandShmBuffer; - -class QWaylandReadbackGlxContext : public QPlatformOpenGLContext -{ -public: - QWaylandReadbackGlxContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen); - - QSurfaceFormat format() const; - - void swapBuffers(QPlatformSurface *surface); - - bool makeCurrent(QPlatformSurface *surface); - void doneCurrent(); - - void (*getProcAddress(const QByteArray &procName)) (); - -private: - GLXContext m_context; - - Display *m_display; - QSurfaceFormat m_format; -}; - -#endif // QWAYLANDREADBACKGLXCONTEXT_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.cpp b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.cpp deleted file mode 100644 index 41a025c6b..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qwaylandreadbackglxintegration.h" - -#include "qwaylandreadbackglxwindow.h" - -#include <QtCore/QDebug> - -QWaylandReadbackGlxIntegration::QWaylandReadbackGlxIntegration(QWaylandDisplay * waylandDispaly) - : QWaylandGLIntegration() - , mWaylandDisplay(waylandDispaly) -{ - qDebug() << "Using Readback-GLX"; - char *display_name = getenv("DISPLAY"); - mDisplay = XOpenDisplay(display_name); - mScreen = XDefaultScreen(mDisplay); - mRootWindow = XDefaultRootWindow(mDisplay); - XSync(mDisplay, False); -} - -QWaylandReadbackGlxIntegration::~QWaylandReadbackGlxIntegration() -{ - XCloseDisplay(mDisplay); -} - -void QWaylandReadbackGlxIntegration::initialize() -{ -} - -QWaylandWindow * QWaylandReadbackGlxIntegration::createEglWindow(QWindow *window) -{ - return new QWaylandReadbackGlxWindow(window,this); -} - -QPlatformOpenGLContext *QWaylandReadbackGlxIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const -{ - return new QWaylandReadbackGlxContext(glFormat, share, mDisplay, mScreen); -} - -QWaylandGLIntegration * QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) -{ - return new QWaylandReadbackGlxIntegration(waylandDisplay); -} - -Display * QWaylandReadbackGlxIntegration::xDisplay() const -{ - return mDisplay; -} - -int QWaylandReadbackGlxIntegration::screen() const -{ - return mScreen; -} - -Window QWaylandReadbackGlxIntegration::rootWindow() const -{ - return mRootWindow; -} - -QWaylandDisplay * QWaylandReadbackGlxIntegration::waylandDisplay() const -{ - return mWaylandDisplay; -} diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.h b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.h deleted file mode 100644 index 94a2073e9..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxintegration.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKGLXINTEGRATION_H -#define QWAYLANDREADBACKGLXINTEGRATION_H - -#include "gl_integration/qwaylandglintegration.h" - -#include <QtCore/QTextStream> -#include <QtCore/QDataStream> -#include <QtCore/QMetaType> -#include <QtCore/QVariant> -#include <QtGui/QWindow> - -#include <X11/Xlib.h> - -class QWaylandReadbackGlxIntegration : public QWaylandGLIntegration -{ -public: - QWaylandReadbackGlxIntegration(QWaylandDisplay * waylandDispaly); - ~QWaylandReadbackGlxIntegration(); - - void initialize(); - - QWaylandWindow *createEglWindow(QWindow *window); - QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const; - - QWaylandDisplay *waylandDisplay() const; - - Display *xDisplay() const; - int screen() const; - Window rootWindow() const; - -private: - QWaylandDisplay *mWaylandDisplay; - - Display *mDisplay; - int mScreen; - Window mRootWindow; - -}; - -#endif // QWAYLANDREADBACKGLXINTEGRATION_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp deleted file mode 100644 index 9ae771eb3..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtDebug> - -#include "qwaylandreadbackglxwindow.h" -#include "qwaylandshmbackingstore.h" - -QWaylandReadbackGlxWindow::QWaylandReadbackGlxWindow(QWindow *window, QWaylandReadbackGlxIntegration *glxIntegration) - : QWaylandShmWindow(window) - , m_glxIntegration(glxIntegration) - , m_buffer(0) - , m_pixmap(0) - , m_config(0) - , m_glxPixmap(0) - , m_window(window) -{ -} - -QWaylandWindow::WindowType QWaylandReadbackGlxWindow::windowType() const -{ - //yeah. this type needs a new name - return QWaylandWindow::Egl; -} - -void QWaylandReadbackGlxWindow::setGeometry(const QRect &rect) -{ - QWaylandShmWindow::setGeometry(rect); - - if (m_pixmap) { - delete mBuffer; - //XFreePixmap deletes the glxPixmap as well - XFreePixmap(m_glxIntegration->xDisplay(), m_pixmap); - m_pixmap = 0; - } -} - -GLXPixmap QWaylandReadbackGlxWindow::glxPixmap() const -{ - if (!m_pixmap) - const_cast<QWaylandReadbackGlxWindow *>(this)->createSurface(); - - return m_glxPixmap; -} - -uchar *QWaylandReadbackGlxWindow::buffer() -{ - return m_buffer->image()->bits(); -} - -void QWaylandReadbackGlxWindow::createSurface() -{ - QSize size(geometry().size()); - if (size.isEmpty()) { - //QGLWidget wants a context for a window without geometry - size = QSize(1,1); - } - - waitForFrameSync(); - - m_buffer = new QWaylandShmBuffer(m_glxIntegration->waylandDisplay(), size, QImage::Format_ARGB32); - attach(m_buffer, 0, 0); - - int depth = XDefaultDepth(m_glxIntegration->xDisplay(), m_glxIntegration->screen()); - m_pixmap = XCreatePixmap(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(), size.width(), size.height(), depth); - XSync(m_glxIntegration->xDisplay(), False); - - if (!m_config) - m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->format()); - - m_glxPixmap = glXCreatePixmap(m_glxIntegration->xDisplay(), m_config, m_pixmap,0); - - if (!m_glxPixmap) - qDebug() << "Could not make glx surface out of pixmap :("; -} - diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h deleted file mode 100644 index 3fc866dcf..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWAYLANDREADBACKGLXWINDOW_H -#define QWAYLANDREADBACKGLXWINDOW_H - -#include "qwaylandshmwindow.h" -#include "qwaylandreadbackglxintegration.h" -#include "qwaylandreadbackglxcontext.h" - -class QWaylandReadbackGlxWindow : public QWaylandShmWindow -{ -public: - QWaylandReadbackGlxWindow(QWindow *window, QWaylandReadbackGlxIntegration *glxIntegration); - WindowType windowType() const; - - void setGeometry(const QRect &rect); - - Pixmap glxPixmap() const; - - uchar *buffer(); - -private: - void createSurface(); - - QWaylandReadbackGlxIntegration *m_glxIntegration; - QWaylandShmBuffer *m_buffer; - - Pixmap m_pixmap; - GLXFBConfig m_config; - GLXPixmap m_glxPixmap; - QWindow *m_window; -}; - -#endif // QWAYLANDREADBACKGLXWINDOW_H diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/readback_glx.pri b/src/plugins/platforms/wayland/gl_integration/readback_glx/readback_glx.pri deleted file mode 100644 index 58b7262a2..000000000 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/readback_glx.pri +++ /dev/null @@ -1,16 +0,0 @@ -HEADERS += \ - $$PWD/qwaylandreadbackglxintegration.h \ - $$PWD/qwaylandreadbackglxwindow.h \ - $$PWD/qwaylandreadbackglxcontext.h - -SOURCES += \ - $$PWD/qwaylandreadbackglxintegration.cpp \ - $$PWD/qwaylandreadbackglxwindow.cpp \ - $$PWD/qwaylandreadbackglxcontext.cpp - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += x11 gl -} else { - LIBS += -lX11 -lGL -} diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri b/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri deleted file mode 100644 index 08f42b43d..000000000 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri +++ /dev/null @@ -1,17 +0,0 @@ -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-egl egl -} else { - LIBS += -lwayland-egl -lEGL -} - -INCLUDEPATH += $$PWD -SOURCES += $$PWD/qwaylandeglintegration.cpp \ - $$PWD/qwaylandglcontext.cpp \ - $$PWD/qwaylandeglwindow.cpp \ - $$PWD/qwaylandegldecoration.cpp - -HEADERS += $$PWD/qwaylandeglintegration.h \ - $$PWD/qwaylandglcontext.h \ - $$PWD/qwaylandeglwindow.h \ - $$PWD/qwaylandegldecoration.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri deleted file mode 100644 index 9b5a19dc6..000000000 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri +++ /dev/null @@ -1,18 +0,0 @@ -include (../xcomposite_share/xcomposite_share.pri) - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite egl x11 -} else { - LIBS += -lXcomposite -lEGL -lX11 -} - -SOURCES += \ - $$PWD/qwaylandxcompositeeglcontext.cpp \ - $$PWD/qwaylandxcompositeeglintegration.cpp \ - $$PWD/qwaylandxcompositeeglwindow.cpp - -HEADERS += \ - $$PWD/qwaylandxcompositeeglcontext.h \ - $$PWD/qwaylandxcompositeeglintegration.h \ - $$PWD/qwaylandxcompositeeglwindow.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/xcomposite_glx.pri b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/xcomposite_glx.pri deleted file mode 100644 index eb1aa78c7..000000000 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/xcomposite_glx.pri +++ /dev/null @@ -1,18 +0,0 @@ -include (../xcomposite_share/xcomposite_share.pri) - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite gl x11 -} else { - LIBS += -lXcomposite -lGL -lX11 -} - -SOURCES += \ - $$PWD/qwaylandxcompositeglxcontext.cpp \ - $$PWD/qwaylandxcompositeglxintegration.cpp \ - $$PWD/qwaylandxcompositeglxwindow.cpp - -HEADERS += \ - $$PWD/qwaylandxcompositeglxcontext.h \ - $$PWD/qwaylandxcompositeglxintegration.h \ - $$PWD/qwaylandxcompositeglxwindow.h diff --git a/src/plugins/platforms/wayland/wayland.json b/src/plugins/platforms/wayland/wayland.json deleted file mode 100644 index 8e56c4fd8..000000000 --- a/src/plugins/platforms/wayland/wayland.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland" ] -} diff --git a/src/plugins/platforms/wayland/qwaylandbuffer.h b/src/plugins/platforms/wayland_common/qwaylandbuffer.h index 357862c90..357862c90 100644 --- a/src/plugins/platforms/wayland/qwaylandbuffer.h +++ b/src/plugins/platforms/wayland_common/qwaylandbuffer.h diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp index 362584b15..362584b15 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.h b/src/plugins/platforms/wayland_common/qwaylandclipboard.h index 7cdc8474f..7cdc8474f 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.h +++ b/src/plugins/platforms/wayland_common/qwaylandclipboard.h diff --git a/src/plugins/platforms/wayland/qwaylandcursor.cpp b/src/plugins/platforms/wayland_common/qwaylandcursor.cpp index 1511abcba..1511abcba 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandcursor.cpp diff --git a/src/plugins/platforms/wayland/qwaylandcursor.h b/src/plugins/platforms/wayland_common/qwaylandcursor.h index 8b4d5e373..8b4d5e373 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor.h +++ b/src/plugins/platforms/wayland_common/qwaylandcursor.h diff --git a/src/plugins/platforms/wayland/qwaylanddatadevicemanager.cpp b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp index 0b22fb2b1..0b22fb2b1 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevicemanager.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp diff --git a/src/plugins/platforms/wayland/qwaylanddatadevicemanager.h b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h index ba2015d1c..ba2015d1c 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevicemanager.h +++ b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h diff --git a/src/plugins/platforms/wayland/qwaylanddataoffer.cpp b/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp index c04807c94..c04807c94 100644 --- a/src/plugins/platforms/wayland/qwaylanddataoffer.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp diff --git a/src/plugins/platforms/wayland/qwaylanddataoffer.h b/src/plugins/platforms/wayland_common/qwaylanddataoffer.h index 46ca3ce39..46ca3ce39 100644 --- a/src/plugins/platforms/wayland/qwaylanddataoffer.h +++ b/src/plugins/platforms/wayland_common/qwaylanddataoffer.h diff --git a/src/plugins/platforms/wayland/qwaylanddatasource.cpp b/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp index ab3f8b599..ab3f8b599 100644 --- a/src/plugins/platforms/wayland/qwaylanddatasource.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp diff --git a/src/plugins/platforms/wayland/qwaylanddatasource.h b/src/plugins/platforms/wayland_common/qwaylanddatasource.h index 7baa05e39..7baa05e39 100644 --- a/src/plugins/platforms/wayland/qwaylanddatasource.h +++ b/src/plugins/platforms/wayland_common/qwaylanddatasource.h diff --git a/src/plugins/platforms/wayland/qwaylanddecoration.cpp b/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp index 9fcc6a8bc..9fcc6a8bc 100644 --- a/src/plugins/platforms/wayland/qwaylanddecoration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp diff --git a/src/plugins/platforms/wayland/qwaylanddecoration.h b/src/plugins/platforms/wayland_common/qwaylanddecoration.h index 30a5e31fa..30a5e31fa 100644 --- a/src/plugins/platforms/wayland/qwaylanddecoration.h +++ b/src/plugins/platforms/wayland_common/qwaylanddecoration.h diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp index 33dc0c58d..83eaee33d 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp @@ -50,7 +50,7 @@ #include "qwaylandshell.h" #ifdef QT_WAYLAND_GL_SUPPORT -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #endif #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland_common/qwaylanddisplay.h index 0e5511821..0e5511821 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland_common/qwaylanddisplay.h diff --git a/src/plugins/platforms/wayland/qwaylanddnd.cpp b/src/plugins/platforms/wayland_common/qwaylanddnd.cpp index 800f4c186..800f4c186 100644 --- a/src/plugins/platforms/wayland/qwaylanddnd.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddnd.cpp diff --git a/src/plugins/platforms/wayland/qwaylanddnd.h b/src/plugins/platforms/wayland_common/qwaylanddnd.h index d766947ea..d766947ea 100644 --- a/src/plugins/platforms/wayland/qwaylanddnd.h +++ b/src/plugins/platforms/wayland_common/qwaylanddnd.h diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp index 5f97a9274..5f97a9274 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput.h b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h index bbf4e060a..bbf4e060a 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedoutput.h +++ b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp index 0f30fcf26..0f30fcf26 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface.h b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h index 9588dfbba..9588dfbba 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h diff --git a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.cpp b/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp index b106f5e06..b106f5e06 100644 --- a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h b/src/plugins/platforms/wayland_common/qwaylandglintegration.h index c015ee1fa..c015ee1fa 100644 --- a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h +++ b/src/plugins/platforms/wayland_common/qwaylandglintegration.h diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp index aaef268e5..aaef268e5 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.h b/src/plugins/platforms/wayland_common/qwaylandinputdevice.h index 716343822..716343822 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.h +++ b/src/plugins/platforms/wayland_common/qwaylandinputdevice.h diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland_common/qwaylandintegration.cpp index 7fabdcbae..b35f0c49f 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandintegration.cpp @@ -64,7 +64,7 @@ #include <qpa/qplatforminputcontext.h> #ifdef QT_WAYLAND_GL_SUPPORT -#include "gl_integration/qwaylandglintegration.h" +#include "qwaylandglintegration.h" #endif #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT diff --git a/src/plugins/platforms/wayland/qwaylandintegration.h b/src/plugins/platforms/wayland_common/qwaylandintegration.h index fe9b113e3..fe9b113e3 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.h +++ b/src/plugins/platforms/wayland_common/qwaylandintegration.h diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp index 3cce96037..3cce96037 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.h b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h index 26372ad3c..26372ad3c 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.h +++ b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h diff --git a/src/plugins/platforms/wayland/qwaylandqtkey.cpp b/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp index a6fe2f520..a6fe2f520 100644 --- a/src/plugins/platforms/wayland/qwaylandqtkey.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp diff --git a/src/plugins/platforms/wayland/qwaylandqtkey.h b/src/plugins/platforms/wayland_common/qwaylandqtkey.h index 8f6dbd298..8f6dbd298 100644 --- a/src/plugins/platforms/wayland/qwaylandqtkey.h +++ b/src/plugins/platforms/wayland_common/qwaylandqtkey.h diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland_common/qwaylandscreen.cpp index 8689c7127..8689c7127 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandscreen.cpp diff --git a/src/plugins/platforms/wayland/qwaylandscreen.h b/src/plugins/platforms/wayland_common/qwaylandscreen.h index 28be6e8b9..28be6e8b9 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.h +++ b/src/plugins/platforms/wayland_common/qwaylandscreen.h diff --git a/src/plugins/platforms/wayland/qwaylandshell.cpp b/src/plugins/platforms/wayland_common/qwaylandshell.cpp index c82bf9bac..c82bf9bac 100644 --- a/src/plugins/platforms/wayland/qwaylandshell.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshell.cpp diff --git a/src/plugins/platforms/wayland/qwaylandshell.h b/src/plugins/platforms/wayland_common/qwaylandshell.h index 16d0a08c8..16d0a08c8 100644 --- a/src/plugins/platforms/wayland/qwaylandshell.h +++ b/src/plugins/platforms/wayland_common/qwaylandshell.h diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp index 53a447214..53a447214 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.h b/src/plugins/platforms/wayland_common/qwaylandshellsurface.h index 8357ec246..8357ec246 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandshellsurface.h diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland_common/qwaylandshmbackingstore.cpp index 8300d9c9b..8300d9c9b 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshmbackingstore.cpp diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.h b/src/plugins/platforms/wayland_common/qwaylandshmbackingstore.h index 1eadb5ed7..1eadb5ed7 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.h +++ b/src/plugins/platforms/wayland_common/qwaylandshmbackingstore.h diff --git a/src/plugins/platforms/wayland/qwaylandshmdecoration.cpp b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp index 6c9373095..6c9373095 100644 --- a/src/plugins/platforms/wayland/qwaylandshmdecoration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp diff --git a/src/plugins/platforms/wayland/qwaylandshmdecoration.h b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h index 4ff0da3d0..4ff0da3d0 100644 --- a/src/plugins/platforms/wayland/qwaylandshmdecoration.h +++ b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h diff --git a/src/plugins/platforms/wayland/qwaylandshmwindow.cpp b/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp index b7ec9d284..b7ec9d284 100644 --- a/src/plugins/platforms/wayland/qwaylandshmwindow.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp diff --git a/src/plugins/platforms/wayland/qwaylandshmwindow.h b/src/plugins/platforms/wayland_common/qwaylandshmwindow.h index ef5e5db07..ef5e5db07 100644 --- a/src/plugins/platforms/wayland/qwaylandshmwindow.h +++ b/src/plugins/platforms/wayland_common/qwaylandshmwindow.h diff --git a/src/plugins/platforms/wayland/qwaylandsubsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp index b92bddc9d..b92bddc9d 100644 --- a/src/plugins/platforms/wayland/qwaylandsubsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp diff --git a/src/plugins/platforms/wayland/qwaylandsubsurface.h b/src/plugins/platforms/wayland_common/qwaylandsubsurface.h index 939b9392f..939b9392f 100644 --- a/src/plugins/platforms/wayland/qwaylandsubsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandsubsurface.h diff --git a/src/plugins/platforms/wayland/qwaylandtouch.cpp b/src/plugins/platforms/wayland_common/qwaylandtouch.cpp index 0c1587305..0c1587305 100644 --- a/src/plugins/platforms/wayland/qwaylandtouch.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandtouch.cpp diff --git a/src/plugins/platforms/wayland/qwaylandtouch.h b/src/plugins/platforms/wayland_common/qwaylandtouch.h index 919bfe878..919bfe878 100644 --- a/src/plugins/platforms/wayland/qwaylandtouch.h +++ b/src/plugins/platforms/wayland_common/qwaylandtouch.h diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp index dc95aa93c..dc95aa93c 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland_common/qwaylandwindow.h index a58e49db1..a58e49db1 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland_common/qwaylandwindow.h diff --git a/src/plugins/platforms/wayland_common/wayland_common.pri b/src/plugins/platforms/wayland_common/wayland_common.pri new file mode 100644 index 000000000..6a58d6fad --- /dev/null +++ b/src/plugins/platforms/wayland_common/wayland_common.pri @@ -0,0 +1,27 @@ +QT += core-private gui-private platformsupport-private +CONFIG += link_pkgconfig qpa/genericunixfontdatabase + +!equals(QT_WAYLAND_GL_CONFIG, nogl) { + DEFINES += QT_WAYLAND_GL_SUPPORT +} + +config_xkbcommon { + !contains(QT_CONFIG, no-pkg-config) { + PKGCONFIG += xkbcommon + } else { + LIBS += -lxkbcommon + } +} else { + DEFINES += QT_NO_WAYLAND_XKB +} + +INCLUDEPATH += $$PWD $$PWD/../../../shared + +!contains(QT_CONFIG, no-pkg-config) { + PKGCONFIG += wayland-client wayland-cursor +} else { + LIBS += -lwayland-client -lwayland-cursor +} + +LIBS += $$PWD/libwayland_common.a + diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland_common/wayland_common.pro index ef4520f02..eab137fa5 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland_common/wayland_common.pro @@ -1,14 +1,23 @@ -TARGET = qwayland - -PLUGIN_TYPE = platforms -load(qt_plugin) +TEMPLATE = lib +CONFIG += staticlib CONFIG += link_pkgconfig qpa/genericunixfontdatabase QT += core-private gui-private platformsupport-private -SOURCES = main.cpp \ - qwaylandintegration.cpp \ +include (windowmanager_integration/windowmanager_integration.pri) + +!equals(QT_WAYLAND_GL_CONFIG, nogl) { + DEFINES += QT_WAYLAND_GL_SUPPORT +} + +!config_xkbcommon { + DEFINES += QT_NO_WAYLAND_XKB +} + +INCLUDEPATH += ../../../shared + +SOURCES += qwaylandintegration.cpp \ qwaylandnativeinterface.cpp \ qwaylandshmbackingstore.cpp \ qwaylandinputdevice.cpp \ @@ -29,17 +38,18 @@ SOURCES = main.cpp \ qwaylandsubsurface.cpp \ qwaylandtouch.cpp \ qwaylandqtkey.cpp \ - $$PWD/../../../shared/qwaylandmimehelper.cpp \ + ../../../shared/qwaylandmimehelper.cpp \ qwaylanddecoration.cpp \ qwaylandshmdecoration.cpp -HEADERS = qwaylandintegration.h \ +HEADERS += qwaylandintegration.h \ qwaylandnativeinterface.h \ qwaylandcursor.h \ qwaylanddisplay.h \ qwaylandwindow.h \ qwaylandscreen.h \ qwaylandshmbackingstore.h \ + qwaylandinputdevice.h \ qwaylandbuffer.h \ qwaylandshmwindow.h \ qwaylandclipboard.h \ @@ -54,40 +64,18 @@ HEADERS = qwaylandintegration.h \ qwaylandsubsurface.h \ qwaylandtouch.h \ qwaylandqtkey.h \ - $$PWD/../../../shared/qwaylandmimehelper.h \ + ../../../shared/qwaylandmimehelper.h \ qwaylanddecoration.h \ qwaylandshmdecoration.h -DEFINES += Q_PLATFORM_WAYLAND - -config_xkbcommon { - !contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += xkbcommon - } else { - LIBS += -lxkbcommon - } -} else { - DEFINES += QT_NO_WAYLAND_XKB +contains(DEFINES, QT_WAYLAND_GL_SUPPORT) { + SOURCES += qwaylandglintegration.cpp + HEADERS += qwaylandglintegration.h } WAYLANDSOURCES += \ - $$PWD/../../../extensions/surface-extension.xml \ - $$PWD/../../../extensions/sub-surface-extension.xml \ - $$PWD/../../../extensions/output-extension.xml \ - $$PWD/../../../extensions/touch-extension.xml \ - $$PWD/../../../extensions/qtkey-extension.xml - - -OTHER_FILES += wayland.json - -INCLUDEPATH += $$PWD/../../../shared - -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-client wayland-cursor -} else { - LIBS += -lwayland-client -lwayland-cursor -} - -include ($$PWD/gl_integration/gl_integration.pri) -include ($$PWD/windowmanager_integration/windowmanager_integration.pri) - + ../../../extensions/surface-extension.xml \ + ../../../extensions/sub-surface-extension.xml \ + ../../../extensions/output-extension.xml \ + ../../../extensions/touch-extension.xml \ + ../../../extensions/qtkey-extension.xml diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp index ba26b79af..ba26b79af 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h index 2e1661cc5..2e1661cc5 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h +++ b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h diff --git a/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri b/src/plugins/platforms/wayland_common/windowmanager_integration/windowmanager_integration.pri index 57905ad9a..57905ad9a 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/windowmanager_integration.pri +++ b/src/plugins/platforms/wayland_common/windowmanager_integration/windowmanager_integration.pri diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.cpp b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp index e14b6f53f..e14b6f53f 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.cpp +++ b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.h b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h index 5a0133d9c..5a0133d9c 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/qwaylandxcompositebuffer.h +++ b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/xcomposite_share.pri b/src/plugins/platforms/xcomposite_share/xcomposite_share.pri index e5f74c454..190fa4697 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_share/xcomposite_share.pri +++ b/src/plugins/platforms/xcomposite_share/xcomposite_share.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -WAYLANDSOURCES += $$PWD/../../../../../extensions/xcomposite.xml +WAYLANDSOURCES += $$PWD/../../../extensions/xcomposite.xml HEADERS += \ $$PWD/qwaylandxcompositebuffer.h |