diff options
author | Mikko Levonmaa <mikko.levonmaa@palm.com> | 2013-03-06 12:31:29 -0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-05-06 12:21:28 +0200 |
commit | fc0b7ec73ce6aa470b6666ad115f3d0e8b83a340 (patch) | |
tree | d8eca663f908d6a2c0f6e726589703136a4c282a | |
parent | db7467e72a8330b0b73546ff3f68e424aeea4b1c (diff) | |
download | meta-qt5-fc0b7ec73ce6aa470b6666ad115f3d0e8b83a340.tar.gz |
qtwayland: Add recipe
* Fix shader precision definition
* MJ: Fix license information
* MJ: Fix PV
* MJ: add wayland-native to depends for wayland-scaner
* MJ: add libxkbcommon to depends, but make it easy to remove it
Signed-off-by: Mikko Levonmaa <mikko.levonmaa@palm.com>
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
6 files changed, 214 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwayland.inc b/recipes-qt/qt5/qtwayland.inc new file mode 100644 index 00000000..32fb08e9 --- /dev/null +++ b/recipes-qt/qt5/qtwayland.inc | |||
@@ -0,0 +1,29 @@ | |||
1 | require qt5module.inc | ||
2 | |||
3 | LICENSE = "BSD & LGPL-2.1 | GPL-3.0" | ||
4 | LIC_FILES_CHKSUM = "file://${S}/src/compositor/compositor_api/qwaylandsurfacenode.cpp;endline=40;md5=e38eccd7e9a6a149c9e31b6fb47daac1 \ | ||
5 | file://${S}/src/compositor/compositor_api/qwaylandcompositor.cpp;endline=39;md5=8897abe415f27031e4237f09db7b9a36 \ | ||
6 | " | ||
7 | |||
8 | # wayland-native is already in wayland DEPENDS, but add it here | ||
9 | # explicitly, because it's native wayland-scanner we're looking for | ||
10 | # libxkbcommon isn't mandatory with 0001-xcbcommon-should-not-be-a-mandatory-dependency.patch | ||
11 | # make it easier to remove by .bbappend (e.g. for building qtwayland with danny which doesn't | ||
12 | # have libxkbcommon in oe-core). | ||
13 | XKB_DEPENDS = "libxkbcommon" | ||
14 | DEPENDS += "qtdeclarative wayland wayland-native ${XKB_DEPENDS}" | ||
15 | |||
16 | INC_PR = "r1" | ||
17 | |||
18 | SRC_URI += " \ | ||
19 | file://0001-xcbcommon-should-not-be-a-mandatory-dependency.patch \ | ||
20 | file://0002-Temporarily-patching-this-out-as-Qt5.0.0-does-not-ha.patch \ | ||
21 | file://0003-eglCreateImageKHR-requires-the-context-to-be-NULL.patch \ | ||
22 | file://0004-EGL-Specify-vec2d-precision-qualifier-in-fragment-sh.patch \ | ||
23 | " | ||
24 | |||
25 | QT_WAYLAND_CONFIG ?= "wayland-compositor" | ||
26 | QT_WAYLAND_DEFINES ?= "" | ||
27 | |||
28 | EXTRA_QMAKEVARS_PRE += "CONFIG+=${QT_WAYLAND_CONFIG}" | ||
29 | EXTRA_QMAKEVARS_PRE += "DEFINES+=${QT_WAYLAND_DEFINES}" | ||
diff --git a/recipes-qt/qt5/qtwayland/0001-xcbcommon-should-not-be-a-mandatory-dependency.patch b/recipes-qt/qt5/qtwayland/0001-xcbcommon-should-not-be-a-mandatory-dependency.patch new file mode 100644 index 00000000..e9e705cd --- /dev/null +++ b/recipes-qt/qt5/qtwayland/0001-xcbcommon-should-not-be-a-mandatory-dependency.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From c8417a2b0b66c26eaa0569c19422f87598e29629 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikko Levonmaa <mikko.levonmaa@palm.com> | ||
3 | Date: Tue, 19 Feb 2013 11:16:05 -0800 | ||
4 | Subject: [PATCH 1/4] xcbcommon should not be a mandatory dependency | ||
5 | |||
6 | Not all platforms that use qtwayland depend on xcbcommon to be present | ||
7 | for them to be functional | ||
8 | |||
9 | Change-Id: I899d9314bdf772a9d5b8b7c143636f9f12c8ad1d | ||
10 | |||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | qtwayland.pro | 6 +++--- | ||
14 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/qtwayland.pro b/qtwayland.pro | ||
17 | index ee0e5ac..f1a6b6f 100644 | ||
18 | --- a/qtwayland.pro | ||
19 | +++ b/qtwayland.pro | ||
20 | @@ -11,15 +11,15 @@ qtCompileTest(xcomposite) | ||
21 | load(qt_parts) | ||
22 | |||
23 | !config_wayland { | ||
24 | - error(QtWayland requires Wayland 1.0.0 or higher) | ||
25 | + error("QtWayland requires Wayland 1.0.0 or higher") | ||
26 | } | ||
27 | |||
28 | !config_xkbcommon { | ||
29 | - error(QtWayland requires xkbcommon 0.2.0 or higher) | ||
30 | + warning("No xkbcommon 0.2.0 or higher found, disabling support for it") | ||
31 | } | ||
32 | |||
33 | !config_wayland_scanner { | ||
34 | - error(QtWayland requires wayland-scanner) | ||
35 | + error("QtWayland requires wayland-scanner") | ||
36 | } | ||
37 | |||
38 | !config_wayland_egl { | ||
39 | -- | ||
40 | 1.8.2.1 | ||
41 | |||
diff --git a/recipes-qt/qt5/qtwayland/0002-Temporarily-patching-this-out-as-Qt5.0.0-does-not-ha.patch b/recipes-qt/qt5/qtwayland/0002-Temporarily-patching-this-out-as-Qt5.0.0-does-not-ha.patch new file mode 100644 index 00000000..0c9bbbe7 --- /dev/null +++ b/recipes-qt/qt5/qtwayland/0002-Temporarily-patching-this-out-as-Qt5.0.0-does-not-ha.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From ae72fc41609c15293b1027ca3f2c4d712e4ae478 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikko Levonmaa <mikko.levonmaa@palm.com> | ||
3 | Date: Fri, 1 Mar 2013 13:00:53 -0800 | ||
4 | Subject: [PATCH 2/4] Temporarily patching this out as Qt5.0.0 does not have | ||
5 | qtHaveModule | ||
6 | |||
7 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
8 | --- | ||
9 | src/compositor/compositor_api/compositor_api.pri | 4 ++-- | ||
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri | ||
13 | index f0bbe76..e7905e5 100644 | ||
14 | --- a/src/compositor/compositor_api/compositor_api.pri | ||
15 | +++ b/src/compositor/compositor_api/compositor_api.pri | ||
16 | @@ -12,7 +12,7 @@ SOURCES += \ | ||
17 | |||
18 | QT += core-private | ||
19 | |||
20 | -qtHaveModule(quick) { | ||
21 | +#qtHaveModule(quick) { | ||
22 | SOURCES += \ | ||
23 | compositor_api/qwaylandsurfaceitem.cpp \ | ||
24 | compositor_api/qwaylandsurfacenode.cpp \ | ||
25 | @@ -27,4 +27,4 @@ qtHaveModule(quick) { | ||
26 | |||
27 | QT += qml quick | ||
28 | QT += quick-private gui-private | ||
29 | -} | ||
30 | +#} | ||
31 | -- | ||
32 | 1.8.2.1 | ||
33 | |||
diff --git a/recipes-qt/qt5/qtwayland/0003-eglCreateImageKHR-requires-the-context-to-be-NULL.patch b/recipes-qt/qt5/qtwayland/0003-eglCreateImageKHR-requires-the-context-to-be-NULL.patch new file mode 100644 index 00000000..48eb870b --- /dev/null +++ b/recipes-qt/qt5/qtwayland/0003-eglCreateImageKHR-requires-the-context-to-be-NULL.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From ca1f46a6192061e254deca1810d25ba423acb8de Mon Sep 17 00:00:00 2001 | ||
2 | From: Mikko Levonmaa <mikko.levonmaa@palm.com> | ||
3 | Date: Wed, 6 Mar 2013 10:18:49 -0800 | ||
4 | Subject: [PATCH 3/4] eglCreateImageKHR requires the context to be NULL | ||
5 | |||
6 | As per the EGL spec the context passed to that function should | ||
7 | be null. | ||
8 | |||
9 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
10 | --- | ||
11 | .../wayland-egl/waylandeglintegration.cpp | 16 ++-------------- | ||
12 | 1 file changed, 2 insertions(+), 14 deletions(-) | ||
13 | |||
14 | diff --git a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp | ||
15 | index 2a923ce..2be1e4c 100644 | ||
16 | --- a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp | ||
17 | +++ b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp | ||
18 | @@ -101,7 +101,6 @@ public: | ||
19 | |||
20 | PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d; | ||
21 | |||
22 | - QPlatformNativeInterface::NativeResourceForContextFunction get_egl_context; | ||
23 | }; | ||
24 | |||
25 | WaylandEglIntegration::WaylandEglIntegration() | ||
26 | @@ -121,10 +120,6 @@ void WaylandEglIntegration::initializeHardware(QtWayland::Display *waylandDispla | ||
27 | const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS); | ||
28 | if (extensionString && strstr(extensionString, "EGL_WL_bind_wayland_display")) | ||
29 | { | ||
30 | - d->get_egl_context = nativeInterface->nativeResourceFunctionForContext("get_egl_context"); | ||
31 | - if (!d->get_egl_context) { | ||
32 | - qWarning("Failed to retrieve the get_egl_context function"); | ||
33 | - } | ||
34 | d->egl_bind_wayland_display = | ||
35 | reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL")); | ||
36 | d->egl_unbind_wayland_display = | ||
37 | @@ -137,7 +132,6 @@ void WaylandEglIntegration::initializeHardware(QtWayland::Display *waylandDispla | ||
38 | reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES")); | ||
39 | |||
40 | if (d->egl_bind_wayland_display | ||
41 | - && d->get_egl_context | ||
42 | && d->egl_unbind_wayland_display | ||
43 | && d->egl_create_image | ||
44 | && d->egl_destroy_image | ||
45 | @@ -162,10 +156,7 @@ GLuint WaylandEglIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGL | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); | ||
50 | - EGLContext egl_context = d->get_egl_context(context); | ||
51 | - | ||
52 | - EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context, | ||
53 | + EGLImageKHR image = d->egl_create_image(d->egl_display, NULL, | ||
54 | EGL_WAYLAND_BUFFER_WL, | ||
55 | buffer, NULL); | ||
56 | |||
57 | @@ -229,10 +220,7 @@ void *WaylandEglIntegration::lockNativeBuffer(struct wl_buffer *buffer, QOpenGLC | ||
58 | { | ||
59 | Q_D(const WaylandEglIntegration); | ||
60 | |||
61 | - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); | ||
62 | - EGLContext egl_context = d->get_egl_context(context); | ||
63 | - | ||
64 | - EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context, | ||
65 | + EGLImageKHR image = d->egl_create_image(d->egl_display, NULL, | ||
66 | EGL_WAYLAND_BUFFER_WL, | ||
67 | buffer, NULL); | ||
68 | return image; | ||
69 | -- | ||
70 | 1.8.2.1 | ||
71 | |||
diff --git a/recipes-qt/qt5/qtwayland/0004-EGL-Specify-vec2d-precision-qualifier-in-fragment-sh.patch b/recipes-qt/qt5/qtwayland/0004-EGL-Specify-vec2d-precision-qualifier-in-fragment-sh.patch new file mode 100644 index 00000000..47ea65fd --- /dev/null +++ b/recipes-qt/qt5/qtwayland/0004-EGL-Specify-vec2d-precision-qualifier-in-fragment-sh.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 5c70644070803b665f64c2d3212b55a4a3270765 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Stone <daniel@fooishbar.org> | ||
3 | Date: Sun, 10 Mar 2013 11:29:38 -0700 | ||
4 | Subject: [PATCH 4/4] EGL: Specify vec2d precision qualifier in fragment shader | ||
5 | |||
6 | GLSL does not specify a default precision qualifier here, so we have to | ||
7 | explicitly define it. Use highp, as it gets redefined to mediump by | ||
8 | QGLShaderProgram when not available. | ||
9 | |||
10 | Signed-off-by: Daniel Stone <daniel@fooishbar.org> | ||
11 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
12 | --- | ||
13 | src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp | ||
17 | index 4d8017d..a0ac6d9 100644 | ||
18 | --- a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp | ||
19 | +++ b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp | ||
20 | @@ -124,7 +124,7 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface) | ||
21 | gl_Position = position;\n\ | ||
22 | outTexCoords = texCoords.xy;\n\ | ||
23 | }"); | ||
24 | - m_blitProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, "varying vec2 outTexCoords;\n\ | ||
25 | + m_blitProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, "varying highp vec2 outTexCoords;\n\ | ||
26 | uniform sampler2D texture;\n\ | ||
27 | void main()\n\ | ||
28 | {\n\ | ||
29 | -- | ||
30 | 1.8.2.1 | ||
31 | |||
diff --git a/recipes-qt/qt5/qtwayland_git.bb b/recipes-qt/qt5/qtwayland_git.bb new file mode 100644 index 00000000..40e386bc --- /dev/null +++ b/recipes-qt/qt5/qtwayland_git.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require ${PN}.inc | ||
2 | require qt5-git.inc | ||
3 | |||
4 | # qtwayland wasn't released yet, last tag before this SRCREV is 5.0.0-beta1 | ||
5 | PV = "4.999+5.0.0-beta1+git${SRCPV}" | ||
6 | |||
7 | PR = "${INC_PR}.1" | ||
8 | |||
9 | SRCREV = "5cb159395eccb1d96fb73a78e499eef30aacb46d" | ||