diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-04-22 17:13:38 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-03 14:38:14 +0000 |
commit | ecf127505effbbf4dbfd1e7cb9561de5dae51bf2 (patch) | |
tree | 35bc46e3511e7a7cf8a6efb1736631d629290874 /src/plugins/platforms/eglfs | |
parent | e6b1e918e12df25a359fbb87ae26f584d46df823 (diff) |
egl: Reshuffle headers to help less fortunate systems with X11
EGL headers including X headers has traditionally been problematic due
to getting macros for Status, None, etc.
In most cases this is not an issue anymore because on embedded one will
almost always use a driver targeting the framebuffer or DRM/KMS and
therefore the EGL headers do not pull in X dependencies.
Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding
the problem altogether with Mesa regardless of targeting X11 or KMS.
However, other drivers do not have this option. On i.MX6 for instance,
targeting X11 is problematic due to not having EGL_API_FB defined, which
in turn means the EGL headers pulls in X headers in order to be able to
define the native display and window types as Display and Window.
Try to play nice with this use case by reshuffling the includes and
undefining the problematic names.
Task-number: QTBUG-52928
Change-Id: I059f26b340b6e442e7296055915d18f5a1ce7a7f
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfscontext.cpp | 1 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfscontext.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsdeviceintegration.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsglobal.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfshooks.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsscreen.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.h | 3 |
10 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp index db35338423..bb638091f7 100644 --- a/src/plugins/platforms/eglfs/qeglfscontext.cpp +++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp @@ -31,6 +31,7 @@ ** ****************************************************************************/ +#include "qeglfsglobal.h" #include <QtGui/QSurface> #include <QtPlatformSupport/private/qeglconvenience_p.h> #include <QtPlatformSupport/private/qeglpbuffer_p.h> diff --git a/src/plugins/platforms/eglfs/qeglfscontext.h b/src/plugins/platforms/eglfs/qeglfscontext.h index 906d11b3d1..8da4c731b8 100644 --- a/src/plugins/platforms/eglfs/qeglfscontext.h +++ b/src/plugins/platforms/eglfs/qeglfscontext.h @@ -34,9 +34,9 @@ #ifndef QEGLFSCONTEXT_H #define QEGLFSCONTEXT_H +#include "qeglfsglobal.h" #include <QtPlatformSupport/private/qeglplatformcontext_p.h> #include <QtCore/QVariant> -#include "qeglfsglobal.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h index 5ec98b37d1..303810eb6e 100644 --- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.h @@ -45,13 +45,12 @@ // We mean it. // +#include "qeglfsglobal.h" #include <qpa/qplatformintegration.h> #include <qpa/qplatformscreen.h> #include <QtCore/QString> #include <QtGui/QSurfaceFormat> #include <QtGui/QImage> -#include <EGL/egl.h> -#include "qeglfsglobal.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsglobal.h b/src/plugins/platforms/eglfs/qeglfsglobal.h index 9109f6be38..bd6e208266 100644 --- a/src/plugins/platforms/eglfs/qeglfsglobal.h +++ b/src/plugins/platforms/eglfs/qeglfsglobal.h @@ -35,6 +35,7 @@ #define QEGLFSGLOBAL_H #include <qglobal.h> +#include <QtPlatformSupport/private/qt_egl_p.h> #ifdef QT_BUILD_EGL_DEVICE_LIB #define Q_EGLFS_EXPORT Q_DECL_EXPORT diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h index 3e4143918e..5f19d492f8 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks.h +++ b/src/plugins/platforms/eglfs/qeglfshooks.h @@ -34,8 +34,8 @@ #ifndef QEGLFSHOOKS_H #define QEGLFSHOOKS_H -#include "qeglfsdeviceintegration.h" #include "qeglfsglobal.h" +#include "qeglfsdeviceintegration.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 35b27cba0b..c226c0134a 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -79,8 +79,6 @@ #include <QtPlatformHeaders/qeglfsfunctions.h> -#include <EGL/egl.h> - static void initResources() { #ifndef QT_NO_CURSOR diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 98c7ee9f78..2edb287b1e 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -34,12 +34,11 @@ #ifndef QEGLFSINTEGRATION_H #define QEGLFSINTEGRATION_H +#include "qeglfsglobal.h" #include <QtCore/QVariant> #include <qpa/qplatformintegration.h> #include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformscreen.h> -#include <EGL/egl.h> -#include "qeglfsglobal.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h index 9b8eaacd51..f20055b4e7 100644 --- a/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h +++ b/src/plugins/platforms/eglfs/qeglfsoffscreenwindow.h @@ -34,9 +34,8 @@ #ifndef QEGLFSOFFSCREENWINDOW_H #define QEGLFSOFFSCREENWINDOW_H -#include <EGL/egl.h> -#include <qpa/qplatformoffscreensurface.h> #include "qeglfsglobal.h" +#include <qpa/qplatformoffscreensurface.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h index 8f1d87ea25..ea669bd5bc 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.h +++ b/src/plugins/platforms/eglfs/qeglfsscreen.h @@ -36,7 +36,6 @@ #include "qeglfsglobal.h" #include <QtCore/QPointer> -#include <EGL/egl.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 806b21de0a..2c396e8ef4 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -34,13 +34,12 @@ #ifndef QEGLFSWINDOW_H #define QEGLFSWINDOW_H +#include "qeglfsglobal.h" #include "qeglfsintegration.h" #include "qeglfsscreen.h" -#include "qeglfsglobal.h" #include <qpa/qplatformwindow.h> #include <QtPlatformSupport/private/qopenglcompositor_p.h> -#include <EGL/egl.h> QT_BEGIN_NAMESPACE |