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

Proposed by Cameron Norman
Status: Rejected
Rejected by: Zisu Andrei
Proposed branch: lp:~cameronnemo/pantheon-greeter/optional-gl
Merge into: lp:~elementary-pantheon/pantheon-greeter/trunk
Diff against target: 168 lines (+66/-34)
4 files modified
CMakeLists.txt (+41/-17)
src/Wallpaper.vala (+8/-0)
vapi-gl/gl.vapi (+17/-0)
vapi/gl.vapi (+0/-17)
To merge this branch: bzr merge lp:~cameronnemo/pantheon-greeter/optional-gl
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Disapprove
kay van der Zander (community) Needs Fixing
Corentin Noël Pending
Review via email: mp+229897@code.launchpad.net

Description of the change

This leaves out GL specific code if GL is not available.

This is Raphael Isemann's branch, just rebased on current trunk (I had to fix a merge conflict). There is a bounty on the bug, but I think that if Raphael is assigned to the bug he will get the bounty so it is probably no problem.

The original merge request was rejected because it did not compile when GL was found (I do not think it was reviewed for without GL), but I tested this branch and it does compile locally.

To post a comment you must log in.
Revision history for this message
kay van der Zander (kay20) wrote :

 crop the packages and options in a cmake variable like sources. this makes the if smaller and removes duplicate of vala_precompile.

review: Needs Fixing
Revision history for this message
kay van der Zander (kay20) wrote :

also the bug report stated that it should work it egl also known as opengl es.
to fix the bug you also need to make it working with opengl es function: https://www.khronos.org/registry/gles/specs/1.1/es_cm_spec_1.1.12.pdf

otherwise we would lose functionality/apperance on arm build.

Revision history for this message
Zisu Andrei (matzipan) wrote :

I'm afraid this MR doesn't try to solve the bug.

review: Disapprove

Unmerged revisions

277. By Cameron Norman

Raphael Isemann: make GL usage optional

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-07-25 18:49:46 +0000
+++ CMakeLists.txt 2014-08-07 05:25:11 +0000
@@ -39,23 +39,47 @@
39file(GLOB_RECURSE sources src/*.vala)39file(GLOB_RECURSE sources src/*.vala)
4040
41include (ValaPrecompile)41include (ValaPrecompile)
42vala_precompile (VALA_C42
43 ${sources}43pkg_check_modules (GL QUIET gl)
44 ${CMAKE_BINARY_DIR}/src/config.vala44if (GL_FOUND)
45PACKAGES45 pkg_check_modules(GL REQUIRED gl)
46 granite46 vala_precompile (VALA_C
47 liblightdm-gobject-147 ${sources}
48 posix48 ${CMAKE_BINARY_DIR}/src/config.vala
49 gdk-pixbuf-2.049 PACKAGES
50 gdk-x11-3.050 granite
51 x1151 liblightdm-gobject-1
52 clutter-gtk-1.052 posix
53 indicator-0.453 gdk-pixbuf-2.0
54 gl54 gdk-x11-3.0
55 posix-fixes55 x11
56OPTIONS56 clutter-gtk-1.0
57 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi57 indicator-0.4
58)58 gl
59 posix-fixes
60 OPTIONS
61 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
62 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi-gl
63 --define=USE_GL
64 )
65else (GL_FOUND)
66 vala_precompile (VALA_C
67 ${sources}
68 ${CMAKE_BINARY_DIR}/src/config.vala
69 PACKAGES
70 granite
71 liblightdm-gobject-1
72 posix
73 gdk-pixbuf-2.0
74 gdk-x11-3.0
75 x11
76 clutter-gtk-1.0
77 indicator-0.4
78 posix-fixes
79 OPTIONS
80 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi
81 )
82endif (GL_FOUND)
5983
60add_subdirectory (po)84add_subdirectory (po)
6185
6286
=== modified file 'src/Wallpaper.vala'
--- src/Wallpaper.vala 2014-03-13 17:16:53 +0000
+++ src/Wallpaper.vala 2014-08-07 05:25:11 +0000
@@ -36,7 +36,9 @@
36 */36 */
37 Queue<GtkClutter.Texture> unused_wallpapers = new Queue<GtkClutter.Texture> ();37 Queue<GtkClutter.Texture> unused_wallpapers = new Queue<GtkClutter.Texture> ();
3838
39#if USE_GL
39 int gpu_limit;40 int gpu_limit;
41#endif
4042
41 string[] cache_path = {};43 string[] cache_path = {};
42 Gdk.Pixbuf[] cache_pixbuf = {};44 Gdk.Pixbuf[] cache_pixbuf = {};
@@ -48,9 +50,11 @@
48 public int screen_height { get; set; }50 public int screen_height { get; set; }
4951
50 public Wallpaper () {52 public Wallpaper () {
53#if USE_GL
51 GL.GLint result = 1;54 GL.GLint result = 1;
52 GL.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, out result);55 GL.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, out result);
53 gpu_limit = result;56 gpu_limit = result;
57#endif
54 }58 }
5559
56 string get_default () {60 string get_default () {
@@ -86,10 +90,12 @@
86 var cancelable = new Cancellable ();90 var cancelable = new Cancellable ();
87 loading_wallpapers.append (cancelable);91 loading_wallpapers.append (cancelable);
88 InputStream stream = yield file.read_async (GLib.Priority.DEFAULT);92 InputStream stream = yield file.read_async (GLib.Priority.DEFAULT);
93#if USE_GL
89 buf = yield Gdk.Pixbuf.new_from_stream_async (stream, cancelable);94 buf = yield Gdk.Pixbuf.new_from_stream_async (stream, cancelable);
90 loading_wallpapers.remove (cancelable);95 loading_wallpapers.remove (cancelable);
91 // we downscale the pixbuf as far as we can on the CPU96 // we downscale the pixbuf as far as we can on the CPU
92 buf = validate_pixbuf (buf);97 buf = validate_pixbuf (buf);
98#endif
93 //add loaded wallpapers and paths to cache99 //add loaded wallpapers and paths to cache
94 cache_path += path;100 cache_path += path;
95 cache_pixbuf += buf;101 cache_pixbuf += buf;
@@ -161,6 +167,7 @@
161 return null;167 return null;
162 }168 }
163169
170#if USE_GL
164 /**171 /**
165 * makes the pixbuf fit inside the GPU limit and scales it to172 * makes the pixbuf fit inside the GPU limit and scales it to
166 * screen size to save memory.173 * screen size to save memory.
@@ -170,6 +177,7 @@
170 result = scale_to_rect (pixbuf, screen_width, screen_height);177 result = scale_to_rect (pixbuf, screen_width, screen_height);
171 return result;178 return result;
172 }179 }
180#endif
173181
174 /**182 /**
175 * Scales the pixbuf down to fit in the given dimensions.183 * Scales the pixbuf down to fit in the given dimensions.
176184
=== added directory 'vapi-gl'
=== added file 'vapi-gl/gl.vapi'
--- vapi-gl/gl.vapi 1970-01-01 00:00:00 +0000
+++ vapi-gl/gl.vapi 2014-08-07 05:25:11 +0000
@@ -0,0 +1,17 @@
1/* gl.vapi generated by vapigen, do not modify. */
2
3[CCode (cprefix = "GL", gir_namespace = "GL", gir_version = "1.0", lower_case_cprefix = "gl_")]
4namespace GL {
5 [CCode (cheader_filename = "GL/gl.h", cname = "GLint")]
6 [SimpleType]
7 public struct GLint : int {
8 }
9 [CCode (cheader_filename = "GL/gl.h", cname = "GLenum")]
10 [SimpleType]
11 public struct GLenum : uint {
12 }
13 [CCode (cheader_filename = "GL/gl.h", cname = "GL_MAX_TEXTURE_SIZE")]
14 public const int GL_MAX_TEXTURE_SIZE;
15 [CCode (cheader_filename = "GL/gl.h", cname = "glGetIntegerv")]
16 public static void glGetIntegerv (GL.GLenum pname, out unowned GL.GLint @params);
17}
018
=== removed file 'vapi/gl.vapi'
--- vapi/gl.vapi 2013-02-17 13:12:35 +0000
+++ vapi/gl.vapi 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1/* gl.vapi generated by vapigen, do not modify. */
2
3[CCode (cprefix = "GL", gir_namespace = "GL", gir_version = "1.0", lower_case_cprefix = "gl_")]
4namespace GL {
5 [CCode (cheader_filename = "GL/gl.h", cname = "GLint")]
6 [SimpleType]
7 public struct GLint : int {
8 }
9 [CCode (cheader_filename = "GL/gl.h", cname = "GLenum")]
10 [SimpleType]
11 public struct GLenum : uint {
12 }
13 [CCode (cheader_filename = "GL/gl.h", cname = "GL_MAX_TEXTURE_SIZE")]
14 public const int GL_MAX_TEXTURE_SIZE;
15 [CCode (cheader_filename = "GL/gl.h", cname = "glGetIntegerv")]
16 public static void glGetIntegerv (GL.GLenum pname, out unowned GL.GLint @params);
17}

Subscribers

People subscribed via source and target branches