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
=== modified file 'images/Makefile.am'
--- images/Makefile.am 2009-08-20 11:07:58 +0000
+++ images/Makefile.am 2009-08-31 19:11:01 +0000
@@ -2,6 +2,20 @@
22
3imagesdir = $(datadir)/images/xsplash3imagesdir = $(datadir)/images/xsplash
44
5images_DATA = xsplash-background.png xsplash-throbber.png5images_DATA = bg_800x600.jpg \
6 bg_1024x768.jpg \
7 bg_1280x1024.jpg \
8 bg_1440x900.jpg \
9 bg_1680x1050.jpg \
10 bg_1920x1200.jpg \
11 bg_2560x1600.jpg \
12 logo_small.png \
13 logo_medium.png \
14 logo_large.png \
15 logo_xtra_large.png \
16 throbber_small.png \
17 throbber_medium.png \
18 throbber_large.png \
19 throbber_xtra-large.png
620
7EXTRA_DIST = $(images_DATA)21EXTRA_DIST = $(images_DATA)
822
=== added file 'images/bg_1024x768.jpg'
9Binary files images/bg_1024x768.jpg 1970-01-01 00:00:00 +0000 and images/bg_1024x768.jpg 2009-08-31 18:47:10 +0000 differ23Binary 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
=== added file 'images/bg_1280x1024.jpg'
10Binary files images/bg_1280x1024.jpg 1970-01-01 00:00:00 +0000 and images/bg_1280x1024.jpg 2009-08-31 18:47:10 +0000 differ24Binary 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
=== added file 'images/bg_1440x900.jpg'
11Binary files images/bg_1440x900.jpg 1970-01-01 00:00:00 +0000 and images/bg_1440x900.jpg 2009-08-31 18:47:10 +0000 differ25Binary 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
=== added file 'images/bg_1680x1050.jpg'
12Binary files images/bg_1680x1050.jpg 1970-01-01 00:00:00 +0000 and images/bg_1680x1050.jpg 2009-08-31 18:47:10 +0000 differ26Binary 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
=== added file 'images/bg_1920x1200.jpg'
13Binary files images/bg_1920x1200.jpg 1970-01-01 00:00:00 +0000 and images/bg_1920x1200.jpg 2009-08-31 18:47:10 +0000 differ27Binary 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
=== added file 'images/bg_2560x1600.jpg'
14Binary files images/bg_2560x1600.jpg 1970-01-01 00:00:00 +0000 and images/bg_2560x1600.jpg 2009-08-31 18:47:10 +0000 differ28Binary 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
=== added file 'images/bg_800x600.jpg'
15Binary files images/bg_800x600.jpg 1970-01-01 00:00:00 +0000 and images/bg_800x600.jpg 2009-08-31 18:47:10 +0000 differ29Binary 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
=== added file 'images/logo_large.png'
16Binary files images/logo_large.png 1970-01-01 00:00:00 +0000 and images/logo_large.png 2009-08-31 18:47:10 +0000 differ30Binary 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
=== added file 'images/logo_medium.png'
17Binary files images/logo_medium.png 1970-01-01 00:00:00 +0000 and images/logo_medium.png 2009-08-31 18:47:10 +0000 differ31Binary 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
=== added file 'images/logo_small.png'
18Binary files images/logo_small.png 1970-01-01 00:00:00 +0000 and images/logo_small.png 2009-08-31 18:47:10 +0000 differ32Binary 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
=== added file 'images/logo_xtra_large.png'
19Binary 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 differ33Binary 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
=== added file 'images/throbber_large.png'
20Binary files images/throbber_large.png 1970-01-01 00:00:00 +0000 and images/throbber_large.png 2009-08-31 18:47:10 +0000 differ34Binary 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
=== added file 'images/throbber_medium.png'
21Binary files images/throbber_medium.png 1970-01-01 00:00:00 +0000 and images/throbber_medium.png 2009-08-31 18:47:10 +0000 differ35Binary 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
=== added file 'images/throbber_small.png'
22Binary files images/throbber_small.png 1970-01-01 00:00:00 +0000 and images/throbber_small.png 2009-08-31 18:47:10 +0000 differ36Binary 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
=== added file 'images/throbber_xtra-large.png'
23Binary 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 differ37Binary 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
=== removed file 'images/xsplash-background.png'
24Binary files images/xsplash-background.png 2009-08-06 14:42:39 +0000 and images/xsplash-background.png 1970-01-01 00:00:00 +0000 differ38Binary 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
=== removed file 'images/xsplash-throbber.png'
25Binary files images/xsplash-throbber.png 2009-08-19 00:44:34 +0000 and images/xsplash-throbber.png 1970-01-01 00:00:00 +0000 differ39Binary 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
=== modified file 'src/xsplash.c'
--- src/xsplash.c 2009-08-26 15:29:53 +0000
+++ src/xsplash.c 2009-09-01 17:22:54 +0000
@@ -267,6 +267,114 @@
267 return gdk_pixbuf_scale_simple (src, new_width, new_height, GDK_INTERP_BILINEAR);267 return gdk_pixbuf_scale_simple (src, new_width, new_height, GDK_INTERP_BILINEAR);
268}268}
269269
270static gchar *
271get_background_filename (void)
272{
273 gint widths[] = { 2560, 1920, 1680, 1440, 1280, 1024, 800 };
274 gint heights[] = { 1600, 1200, 1050, 900, 1024, 768, 600 };
275 gint width, height;
276 gint i;
277 gint last_good = 0;
278 gchar *ret;
279 GdkScreen *screen;
280
281 screen = gdk_screen_get_default ();
282 width = gdk_screen_get_width (screen);
283 height = gdk_screen_get_height (screen);
284
285 g_debug ("get_background_filename(): looking for appropriate resolution...");
286 for (i = 0; i < (sizeof (widths) / sizeof (gint)); i++)
287 {
288 if (widths[i] > width && heights[i] && height)
289 {
290 g_debug (" ** %dx%d will work.", widths[i], heights[i]);
291 last_good = i;
292 }
293 else
294 {
295 g_debug (" ** %dx%d is too small, using last good size.\n", widths[i], heights[i]);
296 break;
297 }
298 }
299
300 g_debug (" ** Found a resolution: %dx%d", widths[last_good], heights[last_good]);
301
302 ret = g_strdup_printf (DATADIR "/images/xsplash/bg_%dx%d.jpg", widths[last_good], heights[last_good]);
303
304 g_debug (" ** filename: %s\n", ret);
305
306 return ret;
307}
308
309static const gchar *
310get_filename_size_modifier (gint width)
311{
312 if (width < 1280)
313 return "small";
314 else if (width < 1600)
315 return "medium";
316 else if (width < 2560)
317 return "large";
318 else
319 return "xtra_large";
320}
321
322static gchar *
323get_throbber_filename (void)
324{
325 gchar *ret;
326 GdkScreen *screen;
327 gint width;
328
329 screen = gdk_screen_get_default ();
330 width = gdk_screen_get_width (screen);
331
332 if (throbber_image != NULL)
333 {
334 g_debug ("get_throbber_filename(): user provided a throbber on the command line; using that\n");
335
336 return g_strdup (throbber_image);
337 }
338
339 g_debug ("get_throbber_filename(): looking for the best throbber for screen width...");
340
341 ret = g_strdup_printf (DATADIR "/images/xsplash/throbber_%s.png",
342 get_filename_size_modifier (width));
343
344 g_debug (" ** Chose `%s'", get_filename_size_modifier (width));
345 g_debug (" ** throbber filename is: %s\n", ret);
346
347 return ret;
348}
349
350static gchar *
351get_logo_filename ()
352{
353 gchar *ret;
354 GdkScreen *screen;
355 gint width;
356
357 screen = gdk_screen_get_default ();
358 width = gdk_screen_get_width (screen);
359
360 if (logo_image != NULL)
361 {
362 g_debug ("get_logo_filename(): user provided a logo on the command line; using that\n");
363
364 return g_strdup (logo_image);
365 }
366
367 g_debug ("get_logo_filename(): looking for the best logo for screen width...");
368
369 ret = g_strdup_printf (DATADIR "/images/xsplash/logo_%s.png",
370 get_filename_size_modifier (width));
371
372 g_debug (" ** Chose `%s'", get_filename_size_modifier (width));
373 g_debug (" ** logo filename is: %s\n", ret);
374
375 return ret;
376}
377
270static GdkPixbuf *378static GdkPixbuf *
271get_pixbuf (gint width, gint height)379get_pixbuf (gint width, gint height)
272{380{
@@ -276,7 +384,8 @@
276384
277 pixbuf = gdk_pixbuf_new_from_file (background_image, NULL);385 pixbuf = gdk_pixbuf_new_from_file (background_image, NULL);
278 scaled = scale_to_min (pixbuf,386 scaled = scale_to_min (pixbuf,
279 width, height);387 width,
388 height);
280389
281 w = gdk_pixbuf_get_width (scaled);390 w = gdk_pixbuf_get_width (scaled);
282 h = gdk_pixbuf_get_height (scaled);391 h = gdk_pixbuf_get_height (scaled);
@@ -325,6 +434,8 @@
325 GdkPixbuf *logo;434 GdkPixbuf *logo;
326 GtkWidget *image;435 GtkWidget *image;
327 GtkWidget *fixed;436 GtkWidget *fixed;
437 gchar *logo_filename;
438 gchar *throbber_filename;
328439
329 priv->dbusobject = NULL;440 priv->dbusobject = NULL;
330 priv->system_bus = NULL;441 priv->system_bus = NULL;
@@ -373,9 +484,13 @@
373 G_CALLBACK (key_press_event),484 G_CALLBACK (key_press_event),
374 server);485 server);
375486
487 logo_filename = get_logo_filename (gdk_screen_get_width (priv->screen));
488 throbber_filename = get_throbber_filename ();
489
376 pixbuf = get_pixbuf (gdk_screen_get_width (priv->screen),490 pixbuf = get_pixbuf (gdk_screen_get_width (priv->screen),
377 gdk_screen_get_height (priv->screen));491 gdk_screen_get_height (priv->screen));
378 logo = gdk_pixbuf_new_from_file (logo_image, NULL);492
493 logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
379494
380 fixed = gtk_fixed_new ();495 fixed = gtk_fixed_new ();
381496
@@ -387,9 +502,9 @@
387 gdk_pixbuf_get_width (pixbuf) / 2 - gdk_pixbuf_get_width (logo) / 2,502 gdk_pixbuf_get_width (pixbuf) / 2 - gdk_pixbuf_get_width (logo) / 2,
388 gdk_pixbuf_get_height (pixbuf) / 3 - gdk_pixbuf_get_height (logo) / 2);503 gdk_pixbuf_get_height (pixbuf) / 3 - gdk_pixbuf_get_height (logo) / 2);
389504
390 if (throbber_image && throbber_frames)505 if (throbber_filename && throbber_frames)
391 {506 {
392 priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_image, NULL);507 priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_filename, NULL);
393508
394 if (priv->throbber_pixbuf != NULL)509 if (priv->throbber_pixbuf != NULL)
395 {510 {
@@ -411,6 +526,12 @@
411 gtk_container_add (GTK_CONTAINER (priv->window), fixed);526 gtk_container_add (GTK_CONTAINER (priv->window), fixed);
412527
413 gtk_widget_show_all (priv->window);528 gtk_widget_show_all (priv->window);
529
530 if (logo_filename)
531 g_free (logo_filename);
532
533 if (throbber_filename)
534 g_free (throbber_filename);
414}535}
415536
416static void537static void
@@ -674,13 +795,13 @@
674 signal (SIGTERM, sig_handler);795 signal (SIGTERM, sig_handler);
675796
676 if (background_image == NULL)797 if (background_image == NULL)
677 background_image = g_strdup ("/usr/share/backgrounds/warty-final-ubuntu.png");798 background_image = get_background_filename ();
678799
679 if (logo_image == NULL)800 if (logo_image == NULL)
680 logo_image = g_strdup ("/usr/share/images/C/ubuntuheader.png");801 logo_image = get_logo_filename ();
681802
682 if (throbber_image == NULL)803 if (throbber_image == NULL)
683 throbber_image = g_strdup (DATADIR "/images/xsplash/xsplash-throbber.png");804 throbber_image = get_throbber_filename ();
684805
685 g_debug ("background_image = %s", background_image);806 g_debug ("background_image = %s", background_image);
686 g_debug ("logo_image = %s", logo_image);807 g_debug ("logo_image = %s", logo_image);

Subscribers

People subscribed via source and target branches