Merge lp:~elementary-apps/pantheon-greeter/optional-gl into lp:~elementary-pantheon/pantheon-greeter/trunk

Proposed by Raphael Isemann on 2013-08-29
Status: Rejected
Rejected by: Cody Garver on 2016-02-27
Proposed branch: lp:~elementary-apps/pantheon-greeter/optional-gl
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 221 lines (+74/-42)
4 files modified
CMakeLists.txt (+41/-17)
src/Wallpaper.vala (+16/-8)
vapi-gl/gl.vapi (+17/-0)
vapi/gl.vapi (+0/-17)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-greeter/optional-gl
Reviewer Review Type Date Requested Status
Corentin Noël Needs Fixing on 2014-09-02
Cody Garver 2013-08-29 Needs Fixing on 2013-09-01
Review via email: mp+182999@code.launchpad.net

Description of the change

Some lines are changed as scratch removed trailing white-space (which is good!).

Otherwise we only use the OpenGL-function for max-texture-size now if the gl-package is available. The greeter will probably crash on devices that use a gigantic screen (like post-4K resolution) or that have a ultra-bad GPU that i can't even imagine in combination with a big screen.

We should make the package that provides gl in debian listed as recommended instead of depends. AFAIK it should work as it only installs the package if it is available. And if the package is not available on ARM, CMake decides to compile without OpenGL which should solve all problems without extra-branches.

To post a comment you must log in.
Raphael Isemann (teemperor) wrote :

Oh, and kudos to cody for the help with conditional compiling.

Cody Garver (codygarver) wrote :
Download full text (5.8 KiB)

CMake stuff works but it fails to compile:

codygarver@cubie:~/greeter/build$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- checking for modules 'granite;liblightdm-gobject-1>=1.2.1;gdk-x11-3.0;clutter-gtk-1.0;indicator3-0.4;gdk-pixbuf-2.0;gl'
-- found granite, version 0.2.2
-- found liblightdm-gobject-1, version 1.2.1
-- found gdk-x11-3.0, version 3.4.1
-- found clutter-gtk-1.0, version 1.4.2
-- found indicator3-0.4, version 0.5.0
-- found gdk-pixbuf-2.0, version 2.26.1
-- found gl, version 8.0.4
-- Found Vala: /usr/bin/valac
-- checking for a minimum Vala version of 0.16.1
-- found Vala, version 0.16.1
-- GSettings schemas will be installed locally.
-- GSettings shemas will be compiled.
-- GSettings schemas will be installed into /usr/share/glib-2.0/schemas/
-- Configuring done
-- Generating done
-- Build files have been written to: /home/codygarver/greeter/build'

codygarver@cubie:~/greeter/build$ make
[ 11%] Generating src/Utilities.c, src/Wallpaper.c, src/ShadowedLabel.c, src/Indicators.c, src/LoginBox.c, src/PantheonGreeter.c, build/src/config.c
Scanning dependencies of target pantheon-greeter
[ 22%] Building C object CMakeFiles/pantheon-greeter.dir/src/Utilities.c.o
/home/codygarver/greeter/build/src/Utilities.c: In function ‘_cogl_material_ref0’:
/home/codygarver/greeter/build/src/Utilities.c:226:2: warning: ‘cogl_material_ref’ is deprecated (declared at /usr/include/cogl/cogl/cogl-material-compat.h:175) [-Wdeprecated-declarations]
/home/codygarver/greeter/build/src/Utilities.c: In function ‘mirror_effect_real_paint_target’:
/home/codygarver/greeter/build/src/Utilities.c:304:9: warning: assignment from incompatible pointer type [enabled by default]
/home/codygarver/greeter/build/src/Utilities.c:363:2: warning: ‘clutter_actor_get_depth’ is deprecated (declared at /usr/include/clutter-1.0/clutter/deprecated/clutter-actor.h:91): Use 'clutter_actor_get_z_position' instead [-Wdeprecated-declarations]
/home/codygarver/greeter/build/src/Utilities.c:379:2: warning: ‘clutter_actor_get_depth’ is deprecated (declared at /usr/include/clutter-1.0/clutter/deprecated/clutter-actor.h:91): Use 'clutter_actor_get_z_position' instead [-Wdeprecated-declarations]
/home/codygarver/greeter/build/src/Utilities.c:396:2: warning: ‘clutter_actor_get_depth’ is deprecated (declared at /usr/include/clutter-1.0/clutter/deprecated/clutter-actor.h:91): Use 'clutter_actor_get_z_position' instead [-Wdeprecated-declarations]
/home/codygarver/greeter/build/src/Utilities.c:411:2: warning: ‘clutter_actor_get_depth’ is deprecated (declared at /usr/include/clutter-1.0/clutter/deprecated/clutter-actor.h:91): Use 'clutter_actor_get_z_position' instead [-Wdeprecated-declarations]
/home/codygarver/greeter/build/src/Utilities.c:420:2: warn...

Read more...

review: Needs Fixing
Corentin Noël (tintou) wrote :

It needs to be recynced to trunk.

Corentin Noël (tintou) :
review: Needs Fixing

Unmerged revisions

214. By Raphael Isemann on 2013-08-29

made gl optional

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-07-23 10:08:27 +0000
3+++ CMakeLists.txt 2013-08-29 19:35:58 +0000
4@@ -36,23 +36,47 @@
5 file(GLOB_RECURSE sources src/*.vala)
6
7 include (ValaPrecompile)
8-vala_precompile (VALA_C
9- ${sources}
10- ${CMAKE_BINARY_DIR}/src/config.vala
11-PACKAGES
12- granite
13- liblightdm-gobject-1
14- posix
15- gdk-pixbuf-2.0
16- gdk-x11-3.0
17- x11
18- clutter-gtk-1.0
19- indicator-0.4
20- gl
21- posix-fixes
22-OPTIONS
23- --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
24-)
25+
26+pkg_check_modules (GL QUIET gl)
27+if (GL_FOUND)
28+ pkg_check_modules(GL REQUIRED gl)
29+ vala_precompile (VALA_C
30+ ${sources}
31+ ${CMAKE_BINARY_DIR}/src/config.vala
32+ PACKAGES
33+ granite
34+ liblightdm-gobject-1
35+ posix
36+ gdk-pixbuf-2.0
37+ gdk-x11-3.0
38+ x11
39+ clutter-gtk-1.0
40+ indicator-0.4
41+ gl
42+ posix-fixes
43+ OPTIONS
44+ --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
45+ --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi-gl
46+ --define=USE_GL
47+ )
48+else (GL_FOUND)
49+ vala_precompile (VALA_C
50+ ${sources}
51+ ${CMAKE_BINARY_DIR}/src/config.vala
52+ PACKAGES
53+ granite
54+ liblightdm-gobject-1
55+ posix
56+ gdk-pixbuf-2.0
57+ gdk-x11-3.0
58+ x11
59+ clutter-gtk-1.0
60+ indicator-0.4
61+ posix-fixes
62+ OPTIONS
63+ --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
64+ )
65+endif (GL_FOUND)
66
67 add_subdirectory (po)
68
69
70=== modified file 'src/Wallpaper.vala'
71--- src/Wallpaper.vala 2013-05-21 21:39:19 +0000
72+++ src/Wallpaper.vala 2013-08-29 19:35:58 +0000
73@@ -25,7 +25,9 @@
74
75 bool second = false;
76
77+#if USE_GL
78 int gpu_limit;
79+#endif
80
81 string[] cache_path = {};
82 Gdk.Pixbuf[] cache_pixbuf = {};
83@@ -47,9 +49,11 @@
84 add_child (background);
85 add_child (background_s);
86
87+#if USE_GL
88 GL.GLint result = 1;
89 GL.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, out result);
90 gpu_limit = result;
91+#endif
92 }
93
94 string get_default () {
95@@ -67,7 +71,7 @@
96 }
97
98 //same wallpaper => abort
99- if(file_path == last_loaded)
100+ if(file_path == last_loaded)
101 return;
102 //mark now loading wallpaper as the last one started loading async
103 last_loaded = file_path;
104@@ -85,7 +89,7 @@
105 second = !second;
106 }
107
108- public async void load_wallpaper (string path, File file, GtkClutter.Texture bot,
109+ public async void load_wallpaper (string path, File file, GtkClutter.Texture bot,
110 GtkClutter.Texture top) {
111
112 try {
113@@ -94,7 +98,9 @@
114 if (buf == null) {
115 InputStream stream = yield file.read_async (GLib.Priority.DEFAULT);
116 buf = yield Gdk.Pixbuf.new_from_stream_async (stream, cancellable);
117+#if USE_GL
118 buf = validate_pixbuf (buf);
119+#endif
120 //add loaded wallpapers and paths to cache
121 cache_path += path;
122 cache_pixbuf += buf;
123@@ -111,13 +117,13 @@
124 top.visible = false;
125 set_child_above_sibling (bot, top);
126 });
127- } catch (Error e) {
128+ } catch (Error e) {
129 if (get_default() != path) {
130 set_wallpaper (get_default());
131 }
132 warning ("Can't load: "+path);
133 warning ("Falling back to default if possible because:");
134- warning (e.message);
135+ warning (e.message);
136 }
137 }
138
139@@ -144,15 +150,17 @@
140 return null;
141 }
142
143+#if USE_GL
144 /**
145- * makes the pixbuf fit inside the GPU limit and scales it to
146+ * makes the pixbuf fit inside the GPU limit and scales it to
147 * screen size to save memory.
148- */
149+ */
150 public Gdk.Pixbuf validate_pixbuf (Gdk.Pixbuf pixbuf) {
151 Gdk.Pixbuf result = scale_to_rect (pixbuf, gpu_limit, gpu_limit);
152 result = scale_to_rect (pixbuf, screen_width, screen_height);
153 return result;
154 }
155+#endif
156
157 /**
158 * Scales the pixbuf down to fit in the given dimensions
159@@ -160,7 +168,7 @@
160 public Gdk.Pixbuf scale_to_rect (Gdk.Pixbuf pixbuf, int rw, int rh) {
161 int h = pixbuf.height;
162 int w = pixbuf.width;
163-
164+
165 if (h > rh || w > rw) {
166 float hw = (float)h/w*rw;
167 float wh = (float)w/h*rh;
168@@ -168,7 +176,7 @@
169 return pixbuf.scale_simple (rw, (int) (hw), Gdk.InterpType.BILINEAR);
170 } else {
171 return pixbuf.scale_simple ((int) (wh), rh, Gdk.InterpType.BILINEAR);
172- }
173+ }
174 }
175 return pixbuf;
176 }
177
178=== added directory 'vapi-gl'
179=== added file 'vapi-gl/gl.vapi'
180--- vapi-gl/gl.vapi 1970-01-01 00:00:00 +0000
181+++ vapi-gl/gl.vapi 2013-08-29 19:35:58 +0000
182@@ -0,0 +1,17 @@
183+/* gl.vapi generated by vapigen, do not modify. */
184+
185+[CCode (cprefix = "GL", gir_namespace = "GL", gir_version = "1.0", lower_case_cprefix = "gl_")]
186+namespace GL {
187+ [CCode (cheader_filename = "GL/gl.h", cname = "GLint")]
188+ [SimpleType]
189+ public struct GLint : int {
190+ }
191+ [CCode (cheader_filename = "GL/gl.h", cname = "GLenum")]
192+ [SimpleType]
193+ public struct GLenum : uint {
194+ }
195+ [CCode (cheader_filename = "GL/gl.h", cname = "GL_MAX_TEXTURE_SIZE")]
196+ public const int GL_MAX_TEXTURE_SIZE;
197+ [CCode (cheader_filename = "GL/gl.h", cname = "glGetIntegerv")]
198+ public static void glGetIntegerv (GL.GLenum pname, out unowned GL.GLint @params);
199+}
200
201=== removed file 'vapi/gl.vapi'
202--- vapi/gl.vapi 2013-02-17 13:12:35 +0000
203+++ vapi/gl.vapi 1970-01-01 00:00:00 +0000
204@@ -1,17 +0,0 @@
205-/* gl.vapi generated by vapigen, do not modify. */
206-
207-[CCode (cprefix = "GL", gir_namespace = "GL", gir_version = "1.0", lower_case_cprefix = "gl_")]
208-namespace GL {
209- [CCode (cheader_filename = "GL/gl.h", cname = "GLint")]
210- [SimpleType]
211- public struct GLint : int {
212- }
213- [CCode (cheader_filename = "GL/gl.h", cname = "GLenum")]
214- [SimpleType]
215- public struct GLenum : uint {
216- }
217- [CCode (cheader_filename = "GL/gl.h", cname = "GL_MAX_TEXTURE_SIZE")]
218- public const int GL_MAX_TEXTURE_SIZE;
219- [CCode (cheader_filename = "GL/gl.h", cname = "glGetIntegerv")]
220- public static void glGetIntegerv (GL.GLenum pname, out unowned GL.GLint @params);
221-}

Subscribers

People subscribed via source and target branches