Merge lp:~mterry/platform-api/gles into lp:platform-api

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 50
Merged at revision: 48
Proposed branch: lp:~mterry/platform-api/gles
Merge into: lp:platform-api
Diff against target: 127 lines (+56/-1)
7 files modified
debian/control (+2/-1)
debian/rules (+10/-0)
include/CMakeLists.txt (+3/-0)
include/config.h.in (+24/-0)
include/ubuntu/ui/session_enumerator.h (+6/-0)
include/ubuntu/ui/ubuntu_ui_session_service.h (+7/-0)
src/android/CMakeLists.txt (+4/-0)
To merge this branch: bzr merge lp:~mterry/platform-api/gles
Reviewer Review Type Date Requested Status
Thomas Voß (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+158128@code.launchpad.net

Commit message

Add ubuntu/ui/config.h with UBUNTU_USE_GLES so we can know whether to include GLES2/gl2.h or GL/gl.h.

Description of the change

My understanding of the intricacies of GL headers is not deep. But it appears that you cannot use both GLES2 and normal GL headers at the same time. That is, GLES/gl2.h and GL/gl.h have conflicting definitions.

In Ubuntu, we want to use GLES2 on armhf, and GL everywhere else. Qt has solved this by using a configure-time flag to change the installed headers to use on or the other.

So here's a change to do the same for platform-api. It adds a new header, ubuntu/ui/config.h which contains UBUNTU_USE_GLES. If this is 1, GLES headers should be used. Otherwise, normal GL headers.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mterry/platform-api/gles updated
49. By Michael Terry

add gl1 build-depends on non-armhf

50. By Michael Terry

add header boilerplate to config.h.in

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomas Voß (thomas-voss) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-03-20 12:49:06 +0000
3+++ debian/control 2013-04-10 15:46:21 +0000
4@@ -3,7 +3,8 @@
5 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
6 Build-Depends: cmake,
7 debhelper (>= 9),
8- libgles2-mesa-dev,
9+ libgl1-mesa-dev[!armhf],
10+ libgles2-mesa-dev[armhf],
11 libhybris-dev,
12 Standards-Version: 3.9.4
13 Section: devel
14
15=== modified file 'debian/rules'
16--- debian/rules 2013-03-18 16:57:10 +0000
17+++ debian/rules 2013-04-10 15:46:21 +0000
18@@ -2,8 +2,18 @@
19
20 DPKG_GENSYMBOLS_CHECK_LEVEL = 4
21
22+gles2_architectures := armhf
23+ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
24+ use_gles=1
25+else
26+ use_gles=0
27+endif
28+
29 %:
30 dh $@
31
32+override_dh_auto_configure:
33+ dh_auto_configure -- -DUSE_GLES=$(use_gles)
34+
35 overrid_dh_install:
36 dh_install --fail-missing
37
38=== modified file 'include/CMakeLists.txt'
39--- include/CMakeLists.txt 2013-02-05 06:58:40 +0000
40+++ include/CMakeLists.txt 2013-04-10 15:46:21 +0000
41@@ -1,1 +1,4 @@
42+configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/ubuntu/ui/config.h)
43+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ubuntu/ui/config.h DESTINATION include/ubuntu/ui)
44+
45 install(DIRECTORY ubuntu DESTINATION include)
46
47=== added file 'include/config.h.in'
48--- include/config.h.in 1970-01-01 00:00:00 +0000
49+++ include/config.h.in 2013-04-10 15:46:21 +0000
50@@ -0,0 +1,24 @@
51+/*
52+ * Copyright © 2013 Canonical Ltd.
53+ *
54+ * This program is free software: you can redistribute it and/or modify
55+ * it under the terms of the GNU Lesser General Public License version 3 as
56+ * published by the Free Software Foundation.
57+ *
58+ * This program is distributed in the hope that it will be useful,
59+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
60+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61+ * GNU Lesser General Public License for more details.
62+ *
63+ * You should have received a copy of the GNU Lesser General Public License
64+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
65+ *
66+ * Authored by: Michael Terry <michael.terry@canonical.com>
67+ */
68+
69+#ifndef UBUNTU_UI_CONFIG_H_
70+#define UBUNTU_UI_CONFIG_H_
71+
72+#define UBUNTU_USE_GLES @USE_GLES@
73+
74+#endif // UBUNTU_UI_CONFIG_H_
75
76=== modified file 'include/ubuntu/ui/session_enumerator.h'
77--- include/ubuntu/ui/session_enumerator.h 2013-02-20 05:24:03 +0000
78+++ include/ubuntu/ui/session_enumerator.h 2013-04-10 15:46:21 +0000
79@@ -21,8 +21,14 @@
80
81 #include "ubuntu/platform/shared_ptr.h"
82 #include "ubuntu/ui/well_known_applications.h"
83+#include "ubuntu/ui/config.h"
84
85+#if UBUNTU_USE_GLES
86 #include <GLES2/gl2.h>
87+#else
88+#include <GL/gl.h>
89+#include <GL/glext.h>
90+#endif
91
92 namespace ubuntu
93 {
94
95=== modified file 'include/ubuntu/ui/ubuntu_ui_session_service.h'
96--- include/ubuntu/ui/ubuntu_ui_session_service.h 2013-03-15 17:55:30 +0000
97+++ include/ubuntu/ui/ubuntu_ui_session_service.h 2013-04-10 15:46:21 +0000
98@@ -19,7 +19,14 @@
99 #ifndef UBUNTU_UI_SESSION_SERVICE_C_API_H_
100 #define UBUNTU_UI_SESSION_SERVICE_C_API_H_
101
102+#include "ubuntu/ui/config.h"
103+
104+#if UBUNTU_USE_GLES
105 #include <GLES2/gl2.h>
106+#else
107+#include <GL/gl.h>
108+#include <GL/glext.h>
109+#endif
110
111 #ifdef __cplusplus
112 extern "C" {
113
114=== modified file 'src/android/CMakeLists.txt'
115--- src/android/CMakeLists.txt 2013-02-06 00:32:45 +0000
116+++ src/android/CMakeLists.txt 2013-04-10 15:46:21 +0000
117@@ -7,6 +7,10 @@
118 ${SOURCES}
119 )
120
121+include_directories(
122+ ${CMAKE_BINARY_DIR}/include
123+)
124+
125 target_link_libraries(
126 ubuntu_application_api
127 hybris_ics

Subscribers

People subscribed via source and target branches