Merge lp:~bratsche/xsplash/new-assets into lp:xsplash

Proposed by Cody Russell
Status: Merged
Approved by: Ted Gould
Approved revision: 63
Merged at revision: not available
Proposed branch: lp:~bratsche/xsplash/new-assets
Merge into: lp:xsplash
Diff against target: None lines
To merge this branch: bzr merge lp:~bratsche/xsplash/new-assets
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+11006@code.launchpad.net

This proposal supersedes a proposal from 2009-09-01.

To post a comment you must log in.
Revision history for this message
Cody Russell (bratsche) wrote : Posted in a previous version of this proposal

mt kicks ass.

lp:~bratsche/xsplash/new-assets updated
63. By Cody Russell

Fix when fading from 0 to 1

Revision history for this message
Cody Russell (bratsche) wrote :

This one has been back and forth. Right now the larger images don't seem to work on Intel hardware and compiz. It works fine on metacity compositor though, and it works fine on nvidia hardware with compiz/metacity.

I don't believe this should be a blocker. What happens with Intel hardware and compiz right now is that xsplash displays, but the fade-out doesn't work because it seems like it's unable to load the image into a GL texture or something like that. It can't be because the image is too large though, because warty-final-ubuntu.png is large and it loads fine. There must be something wrong with these images, and I don't know yet what it is.

I'm of the opinion that we should go ahead and merge this into master, and then fix the images ASAP.

Revision history for this message
Ted Gould (ted) wrote :

Looks good. I agree that we shouldn't block this based on Compiz support on some graphics cards.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'images/Makefile.am'
2--- images/Makefile.am 2009-08-20 11:07:58 +0000
3+++ images/Makefile.am 2009-08-31 19:11:01 +0000
4@@ -2,6 +2,20 @@
5
6 imagesdir = $(datadir)/images/xsplash
7
8-images_DATA = xsplash-background.png xsplash-throbber.png
9+images_DATA = bg_800x600.jpg \
10+ bg_1024x768.jpg \
11+ bg_1280x1024.jpg \
12+ bg_1440x900.jpg \
13+ bg_1680x1050.jpg \
14+ bg_1920x1200.jpg \
15+ bg_2560x1600.jpg \
16+ logo_small.png \
17+ logo_medium.png \
18+ logo_large.png \
19+ logo_xtra_large.png \
20+ throbber_small.png \
21+ throbber_medium.png \
22+ throbber_large.png \
23+ throbber_xtra-large.png
24
25 EXTRA_DIST = $(images_DATA)
26
27=== added file 'images/bg_1024x768.jpg'
28Binary files images/bg_1024x768.jpg 1970-01-01 00:00:00 +0000 and images/bg_1024x768.jpg 2009-08-31 18:47:10 +0000 differ
29=== added file 'images/bg_1280x1024.jpg'
30Binary files images/bg_1280x1024.jpg 1970-01-01 00:00:00 +0000 and images/bg_1280x1024.jpg 2009-08-31 18:47:10 +0000 differ
31=== added file 'images/bg_1440x900.jpg'
32Binary files images/bg_1440x900.jpg 1970-01-01 00:00:00 +0000 and images/bg_1440x900.jpg 2009-08-31 18:47:10 +0000 differ
33=== added file 'images/bg_1680x1050.jpg'
34Binary files images/bg_1680x1050.jpg 1970-01-01 00:00:00 +0000 and images/bg_1680x1050.jpg 2009-08-31 18:47:10 +0000 differ
35=== added file 'images/bg_1920x1200.jpg'
36Binary files images/bg_1920x1200.jpg 1970-01-01 00:00:00 +0000 and images/bg_1920x1200.jpg 2009-08-31 18:47:10 +0000 differ
37=== added file 'images/bg_2560x1600.jpg'
38Binary files images/bg_2560x1600.jpg 1970-01-01 00:00:00 +0000 and images/bg_2560x1600.jpg 2009-08-31 18:47:10 +0000 differ
39=== added file 'images/bg_800x600.jpg'
40Binary files images/bg_800x600.jpg 1970-01-01 00:00:00 +0000 and images/bg_800x600.jpg 2009-08-31 18:47:10 +0000 differ
41=== added file 'images/logo_large.png'
42Binary files images/logo_large.png 1970-01-01 00:00:00 +0000 and images/logo_large.png 2009-08-31 18:47:10 +0000 differ
43=== added file 'images/logo_medium.png'
44Binary files images/logo_medium.png 1970-01-01 00:00:00 +0000 and images/logo_medium.png 2009-08-31 18:47:10 +0000 differ
45=== added file 'images/logo_small.png'
46Binary files images/logo_small.png 1970-01-01 00:00:00 +0000 and images/logo_small.png 2009-08-31 18:47:10 +0000 differ
47=== added file 'images/logo_xtra_large.png'
48Binary files images/logo_xtra_large.png 1970-01-01 00:00:00 +0000 and images/logo_xtra_large.png 2009-08-31 18:47:10 +0000 differ
49=== added file 'images/throbber_large.png'
50Binary files images/throbber_large.png 1970-01-01 00:00:00 +0000 and images/throbber_large.png 2009-08-31 18:47:10 +0000 differ
51=== added file 'images/throbber_medium.png'
52Binary files images/throbber_medium.png 1970-01-01 00:00:00 +0000 and images/throbber_medium.png 2009-08-31 18:47:10 +0000 differ
53=== added file 'images/throbber_small.png'
54Binary files images/throbber_small.png 1970-01-01 00:00:00 +0000 and images/throbber_small.png 2009-08-31 18:47:10 +0000 differ
55=== added file 'images/throbber_xtra-large.png'
56Binary files images/throbber_xtra-large.png 1970-01-01 00:00:00 +0000 and images/throbber_xtra-large.png 2009-08-31 18:47:10 +0000 differ
57=== removed file 'images/xsplash-background.png'
58Binary files images/xsplash-background.png 2009-08-06 14:42:39 +0000 and images/xsplash-background.png 1970-01-01 00:00:00 +0000 differ
59=== removed file 'images/xsplash-throbber.png'
60Binary files images/xsplash-throbber.png 2009-08-19 00:44:34 +0000 and images/xsplash-throbber.png 1970-01-01 00:00:00 +0000 differ
61=== modified file 'src/xsplash.c'
62--- src/xsplash.c 2009-08-26 15:29:53 +0000
63+++ src/xsplash.c 2009-09-01 17:22:54 +0000
64@@ -267,6 +267,114 @@
65 return gdk_pixbuf_scale_simple (src, new_width, new_height, GDK_INTERP_BILINEAR);
66 }
67
68+static gchar *
69+get_background_filename (void)
70+{
71+ gint widths[] = { 2560, 1920, 1680, 1440, 1280, 1024, 800 };
72+ gint heights[] = { 1600, 1200, 1050, 900, 1024, 768, 600 };
73+ gint width, height;
74+ gint i;
75+ gint last_good = 0;
76+ gchar *ret;
77+ GdkScreen *screen;
78+
79+ screen = gdk_screen_get_default ();
80+ width = gdk_screen_get_width (screen);
81+ height = gdk_screen_get_height (screen);
82+
83+ g_debug ("get_background_filename(): looking for appropriate resolution...");
84+ for (i = 0; i < (sizeof (widths) / sizeof (gint)); i++)
85+ {
86+ if (widths[i] > width && heights[i] && height)
87+ {
88+ g_debug (" ** %dx%d will work.", widths[i], heights[i]);
89+ last_good = i;
90+ }
91+ else
92+ {
93+ g_debug (" ** %dx%d is too small, using last good size.\n", widths[i], heights[i]);
94+ break;
95+ }
96+ }
97+
98+ g_debug (" ** Found a resolution: %dx%d", widths[last_good], heights[last_good]);
99+
100+ ret = g_strdup_printf (DATADIR "/images/xsplash/bg_%dx%d.jpg", widths[last_good], heights[last_good]);
101+
102+ g_debug (" ** filename: %s\n", ret);
103+
104+ return ret;
105+}
106+
107+static const gchar *
108+get_filename_size_modifier (gint width)
109+{
110+ if (width < 1280)
111+ return "small";
112+ else if (width < 1600)
113+ return "medium";
114+ else if (width < 2560)
115+ return "large";
116+ else
117+ return "xtra_large";
118+}
119+
120+static gchar *
121+get_throbber_filename (void)
122+{
123+ gchar *ret;
124+ GdkScreen *screen;
125+ gint width;
126+
127+ screen = gdk_screen_get_default ();
128+ width = gdk_screen_get_width (screen);
129+
130+ if (throbber_image != NULL)
131+ {
132+ g_debug ("get_throbber_filename(): user provided a throbber on the command line; using that\n");
133+
134+ return g_strdup (throbber_image);
135+ }
136+
137+ g_debug ("get_throbber_filename(): looking for the best throbber for screen width...");
138+
139+ ret = g_strdup_printf (DATADIR "/images/xsplash/throbber_%s.png",
140+ get_filename_size_modifier (width));
141+
142+ g_debug (" ** Chose `%s'", get_filename_size_modifier (width));
143+ g_debug (" ** throbber filename is: %s\n", ret);
144+
145+ return ret;
146+}
147+
148+static gchar *
149+get_logo_filename ()
150+{
151+ gchar *ret;
152+ GdkScreen *screen;
153+ gint width;
154+
155+ screen = gdk_screen_get_default ();
156+ width = gdk_screen_get_width (screen);
157+
158+ if (logo_image != NULL)
159+ {
160+ g_debug ("get_logo_filename(): user provided a logo on the command line; using that\n");
161+
162+ return g_strdup (logo_image);
163+ }
164+
165+ g_debug ("get_logo_filename(): looking for the best logo for screen width...");
166+
167+ ret = g_strdup_printf (DATADIR "/images/xsplash/logo_%s.png",
168+ get_filename_size_modifier (width));
169+
170+ g_debug (" ** Chose `%s'", get_filename_size_modifier (width));
171+ g_debug (" ** logo filename is: %s\n", ret);
172+
173+ return ret;
174+}
175+
176 static GdkPixbuf *
177 get_pixbuf (gint width, gint height)
178 {
179@@ -276,7 +384,8 @@
180
181 pixbuf = gdk_pixbuf_new_from_file (background_image, NULL);
182 scaled = scale_to_min (pixbuf,
183- width, height);
184+ width,
185+ height);
186
187 w = gdk_pixbuf_get_width (scaled);
188 h = gdk_pixbuf_get_height (scaled);
189@@ -325,6 +434,8 @@
190 GdkPixbuf *logo;
191 GtkWidget *image;
192 GtkWidget *fixed;
193+ gchar *logo_filename;
194+ gchar *throbber_filename;
195
196 priv->dbusobject = NULL;
197 priv->system_bus = NULL;
198@@ -373,9 +484,13 @@
199 G_CALLBACK (key_press_event),
200 server);
201
202+ logo_filename = get_logo_filename (gdk_screen_get_width (priv->screen));
203+ throbber_filename = get_throbber_filename ();
204+
205 pixbuf = get_pixbuf (gdk_screen_get_width (priv->screen),
206 gdk_screen_get_height (priv->screen));
207- logo = gdk_pixbuf_new_from_file (logo_image, NULL);
208+
209+ logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
210
211 fixed = gtk_fixed_new ();
212
213@@ -387,9 +502,9 @@
214 gdk_pixbuf_get_width (pixbuf) / 2 - gdk_pixbuf_get_width (logo) / 2,
215 gdk_pixbuf_get_height (pixbuf) / 3 - gdk_pixbuf_get_height (logo) / 2);
216
217- if (throbber_image && throbber_frames)
218+ if (throbber_filename && throbber_frames)
219 {
220- priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_image, NULL);
221+ priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_filename, NULL);
222
223 if (priv->throbber_pixbuf != NULL)
224 {
225@@ -411,6 +526,12 @@
226 gtk_container_add (GTK_CONTAINER (priv->window), fixed);
227
228 gtk_widget_show_all (priv->window);
229+
230+ if (logo_filename)
231+ g_free (logo_filename);
232+
233+ if (throbber_filename)
234+ g_free (throbber_filename);
235 }
236
237 static void
238@@ -674,13 +795,13 @@
239 signal (SIGTERM, sig_handler);
240
241 if (background_image == NULL)
242- background_image = g_strdup ("/usr/share/backgrounds/warty-final-ubuntu.png");
243+ background_image = get_background_filename ();
244
245 if (logo_image == NULL)
246- logo_image = g_strdup ("/usr/share/images/C/ubuntuheader.png");
247+ logo_image = get_logo_filename ();
248
249 if (throbber_image == NULL)
250- throbber_image = g_strdup (DATADIR "/images/xsplash/xsplash-throbber.png");
251+ throbber_image = get_throbber_filename ();
252
253 g_debug ("background_image = %s", background_image);
254 g_debug ("logo_image = %s", logo_image);

Subscribers

People subscribed via source and target branches