Mir

Merge lp:~alan-griffiths/mir/do-not-requre-miregl into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4286
Proposed branch: lp:~alan-griffiths/mir/do-not-requre-miregl
Merge into: lp:mir
Diff against target: 67 lines (+17/-2)
1 file modified
examples/miral-shell/spinner/eglspinner.cpp (+17/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/do-not-requre-miregl
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Alberto Aguirre (community) Approve
Review via email: mp+332150@code.launchpad.net

Commit message

Don't use Mir EGL if it isn't available

Description of the change

Don't use Mir EGL if it isn't available

Useful when building Mir on Debian or Fedora

To post a comment you must log in.
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

OK.

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4282
https://mir-jenkins.ubuntu.com/job/mir-ci/3724/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5109
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5347
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5334
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5153/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5153
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5153/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3724/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/miral-shell/spinner/eglspinner.cpp'
2--- examples/miral-shell/spinner/eglspinner.cpp 2017-08-21 15:58:34 +0000
3+++ examples/miral-shell/spinner/eglspinner.cpp 2017-10-11 17:45:38 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright © 2013-2015 Canonical Ltd.
7+ * Copyright © 2013-2017 Canonical Ltd.
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * under the terms of the GNU General Public License version 2 or 3 as as
11@@ -19,6 +19,14 @@
12 * Kevin DuBois <kevin.dubois@canonical.com>
13 */
14
15+// Ugly way to detect the Mir EGL patch to mesa
16+// NB this has to be before any other includes
17+#define MIR_EGL_PLATFORM
18+#include <EGL/eglplatform.h>
19+#ifndef MIR_CLIENT_API_VERSION
20+#define MIR_EGL_UNAVAILABLE
21+#endif
22+
23 #include "splash.h"
24
25 #include <chrono>
26@@ -143,7 +151,7 @@
27 //1.) 0.0 - 0.6: logo fades in fully
28 //2.) 0.0 - 6.0: logo does one full spin 360°
29 //3.) 6.0 - 6.833: glow fades in fully, black-background fades out to 50%
30- //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0%
31+ //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0%
32 //5.) 7.666 - 8.266: logo fades out fully
33 //8.266..: now spinner can be closed as all its elements are faded out
34
35@@ -221,11 +229,14 @@
36 "} \n";
37
38 std::atomic<bool> dying{false};
39+
40+#ifndef MIR_EGL_UNAVAILABLE
41 void lifecycle_event_callback(MirConnection* /*connection*/, MirLifecycleState state, void* context)
42 {
43 if (state == mir_lifecycle_connection_lost)
44 static_cast<decltype(dying)*>(context)->store(true);
45 }
46+#endif
47 }
48
49 struct SpinnerSplash::Self
50@@ -254,6 +265,7 @@
51 void SpinnerSplash::operator()(MirConnection* const connection)
52 try
53 {
54+#ifndef MIR_EGL_UNAVAILABLE
55 GLuint prog[2];
56 GLuint texture[2];
57 GLint vpos[2];
58@@ -365,6 +377,9 @@
59
60 glDeleteTextures(2, texture);
61 g_timer_destroy (timer);
62+#else
63+ (void)connection;
64+#endif
65 }
66 catch (std::exception const& x)
67 {

Subscribers

People subscribed via source and target branches