Merge lp:~bratsche/xsplash/new-assets into lp:xsplash
- new-assets
- Merge into trunk
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 | ||||
Related bugs: |
|
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.
Commit message
Description of the change
Cody Russell (bratsche) wrote : Posted in a previous version of this proposal | # |
- 63. By Cody Russell
-
Fix when fading from 0 to 1
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-
I'm of the opinion that we should go ahead and merge this into master, and then fix the images ASAP.
Ted Gould (ted) wrote : | # |
Looks good. I agree that we shouldn't block this based on Compiz support on some graphics cards.
Preview Diff
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 | 2 | 2 | ||
6 | 3 | imagesdir = $(datadir)/images/xsplash | 3 | imagesdir = $(datadir)/images/xsplash |
7 | 4 | 4 | ||
9 | 5 | images_DATA = xsplash-background.png xsplash-throbber.png | 5 | images_DATA = bg_800x600.jpg \ |
10 | 6 | bg_1024x768.jpg \ | ||
11 | 7 | bg_1280x1024.jpg \ | ||
12 | 8 | bg_1440x900.jpg \ | ||
13 | 9 | bg_1680x1050.jpg \ | ||
14 | 10 | bg_1920x1200.jpg \ | ||
15 | 11 | bg_2560x1600.jpg \ | ||
16 | 12 | logo_small.png \ | ||
17 | 13 | logo_medium.png \ | ||
18 | 14 | logo_large.png \ | ||
19 | 15 | logo_xtra_large.png \ | ||
20 | 16 | throbber_small.png \ | ||
21 | 17 | throbber_medium.png \ | ||
22 | 18 | throbber_large.png \ | ||
23 | 19 | throbber_xtra-large.png | ||
24 | 6 | 20 | ||
25 | 7 | EXTRA_DIST = $(images_DATA) | 21 | EXTRA_DIST = $(images_DATA) |
26 | 8 | 22 | ||
27 | === added file 'images/bg_1024x768.jpg' | |||
28 | 9 | Binary 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 | 23 | Binary 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' | |||
30 | 10 | Binary 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 | 24 | Binary 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' | |||
32 | 11 | Binary 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 | 25 | Binary 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' | |||
34 | 12 | Binary 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 | 26 | Binary 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' | |||
36 | 13 | Binary 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 | 27 | Binary 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' | |||
38 | 14 | Binary 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 | 28 | Binary 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' | |||
40 | 15 | Binary 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 | 29 | Binary 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' | |||
42 | 16 | Binary 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 | 30 | Binary 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' | |||
44 | 17 | Binary 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 | 31 | Binary 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' | |||
46 | 18 | Binary 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 | 32 | Binary 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' | |||
48 | 19 | Binary 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 | 33 | Binary 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' | |||
50 | 20 | Binary 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 | 34 | Binary 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' | |||
52 | 21 | Binary 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 | 35 | Binary 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' | |||
54 | 22 | Binary 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 | 36 | Binary 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' | |||
56 | 23 | Binary 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 | 37 | Binary 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' | |||
58 | 24 | Binary 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 | 38 | Binary 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' | |||
60 | 25 | Binary 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 | 39 | Binary 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 | 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); |
66 | 268 | } | 268 | } |
67 | 269 | 269 | ||
68 | 270 | static gchar * | ||
69 | 271 | get_background_filename (void) | ||
70 | 272 | { | ||
71 | 273 | gint widths[] = { 2560, 1920, 1680, 1440, 1280, 1024, 800 }; | ||
72 | 274 | gint heights[] = { 1600, 1200, 1050, 900, 1024, 768, 600 }; | ||
73 | 275 | gint width, height; | ||
74 | 276 | gint i; | ||
75 | 277 | gint last_good = 0; | ||
76 | 278 | gchar *ret; | ||
77 | 279 | GdkScreen *screen; | ||
78 | 280 | |||
79 | 281 | screen = gdk_screen_get_default (); | ||
80 | 282 | width = gdk_screen_get_width (screen); | ||
81 | 283 | height = gdk_screen_get_height (screen); | ||
82 | 284 | |||
83 | 285 | g_debug ("get_background_filename(): looking for appropriate resolution..."); | ||
84 | 286 | for (i = 0; i < (sizeof (widths) / sizeof (gint)); i++) | ||
85 | 287 | { | ||
86 | 288 | if (widths[i] > width && heights[i] && height) | ||
87 | 289 | { | ||
88 | 290 | g_debug (" ** %dx%d will work.", widths[i], heights[i]); | ||
89 | 291 | last_good = i; | ||
90 | 292 | } | ||
91 | 293 | else | ||
92 | 294 | { | ||
93 | 295 | g_debug (" ** %dx%d is too small, using last good size.\n", widths[i], heights[i]); | ||
94 | 296 | break; | ||
95 | 297 | } | ||
96 | 298 | } | ||
97 | 299 | |||
98 | 300 | g_debug (" ** Found a resolution: %dx%d", widths[last_good], heights[last_good]); | ||
99 | 301 | |||
100 | 302 | ret = g_strdup_printf (DATADIR "/images/xsplash/bg_%dx%d.jpg", widths[last_good], heights[last_good]); | ||
101 | 303 | |||
102 | 304 | g_debug (" ** filename: %s\n", ret); | ||
103 | 305 | |||
104 | 306 | return ret; | ||
105 | 307 | } | ||
106 | 308 | |||
107 | 309 | static const gchar * | ||
108 | 310 | get_filename_size_modifier (gint width) | ||
109 | 311 | { | ||
110 | 312 | if (width < 1280) | ||
111 | 313 | return "small"; | ||
112 | 314 | else if (width < 1600) | ||
113 | 315 | return "medium"; | ||
114 | 316 | else if (width < 2560) | ||
115 | 317 | return "large"; | ||
116 | 318 | else | ||
117 | 319 | return "xtra_large"; | ||
118 | 320 | } | ||
119 | 321 | |||
120 | 322 | static gchar * | ||
121 | 323 | get_throbber_filename (void) | ||
122 | 324 | { | ||
123 | 325 | gchar *ret; | ||
124 | 326 | GdkScreen *screen; | ||
125 | 327 | gint width; | ||
126 | 328 | |||
127 | 329 | screen = gdk_screen_get_default (); | ||
128 | 330 | width = gdk_screen_get_width (screen); | ||
129 | 331 | |||
130 | 332 | if (throbber_image != NULL) | ||
131 | 333 | { | ||
132 | 334 | g_debug ("get_throbber_filename(): user provided a throbber on the command line; using that\n"); | ||
133 | 335 | |||
134 | 336 | return g_strdup (throbber_image); | ||
135 | 337 | } | ||
136 | 338 | |||
137 | 339 | g_debug ("get_throbber_filename(): looking for the best throbber for screen width..."); | ||
138 | 340 | |||
139 | 341 | ret = g_strdup_printf (DATADIR "/images/xsplash/throbber_%s.png", | ||
140 | 342 | get_filename_size_modifier (width)); | ||
141 | 343 | |||
142 | 344 | g_debug (" ** Chose `%s'", get_filename_size_modifier (width)); | ||
143 | 345 | g_debug (" ** throbber filename is: %s\n", ret); | ||
144 | 346 | |||
145 | 347 | return ret; | ||
146 | 348 | } | ||
147 | 349 | |||
148 | 350 | static gchar * | ||
149 | 351 | get_logo_filename () | ||
150 | 352 | { | ||
151 | 353 | gchar *ret; | ||
152 | 354 | GdkScreen *screen; | ||
153 | 355 | gint width; | ||
154 | 356 | |||
155 | 357 | screen = gdk_screen_get_default (); | ||
156 | 358 | width = gdk_screen_get_width (screen); | ||
157 | 359 | |||
158 | 360 | if (logo_image != NULL) | ||
159 | 361 | { | ||
160 | 362 | g_debug ("get_logo_filename(): user provided a logo on the command line; using that\n"); | ||
161 | 363 | |||
162 | 364 | return g_strdup (logo_image); | ||
163 | 365 | } | ||
164 | 366 | |||
165 | 367 | g_debug ("get_logo_filename(): looking for the best logo for screen width..."); | ||
166 | 368 | |||
167 | 369 | ret = g_strdup_printf (DATADIR "/images/xsplash/logo_%s.png", | ||
168 | 370 | get_filename_size_modifier (width)); | ||
169 | 371 | |||
170 | 372 | g_debug (" ** Chose `%s'", get_filename_size_modifier (width)); | ||
171 | 373 | g_debug (" ** logo filename is: %s\n", ret); | ||
172 | 374 | |||
173 | 375 | return ret; | ||
174 | 376 | } | ||
175 | 377 | |||
176 | 270 | static GdkPixbuf * | 378 | static GdkPixbuf * |
177 | 271 | get_pixbuf (gint width, gint height) | 379 | get_pixbuf (gint width, gint height) |
178 | 272 | { | 380 | { |
179 | @@ -276,7 +384,8 @@ | |||
180 | 276 | 384 | ||
181 | 277 | pixbuf = gdk_pixbuf_new_from_file (background_image, NULL); | 385 | pixbuf = gdk_pixbuf_new_from_file (background_image, NULL); |
182 | 278 | scaled = scale_to_min (pixbuf, | 386 | scaled = scale_to_min (pixbuf, |
184 | 279 | width, height); | 387 | width, |
185 | 388 | height); | ||
186 | 280 | 389 | ||
187 | 281 | w = gdk_pixbuf_get_width (scaled); | 390 | w = gdk_pixbuf_get_width (scaled); |
188 | 282 | h = gdk_pixbuf_get_height (scaled); | 391 | h = gdk_pixbuf_get_height (scaled); |
189 | @@ -325,6 +434,8 @@ | |||
190 | 325 | GdkPixbuf *logo; | 434 | GdkPixbuf *logo; |
191 | 326 | GtkWidget *image; | 435 | GtkWidget *image; |
192 | 327 | GtkWidget *fixed; | 436 | GtkWidget *fixed; |
193 | 437 | gchar *logo_filename; | ||
194 | 438 | gchar *throbber_filename; | ||
195 | 328 | 439 | ||
196 | 329 | priv->dbusobject = NULL; | 440 | priv->dbusobject = NULL; |
197 | 330 | priv->system_bus = NULL; | 441 | priv->system_bus = NULL; |
198 | @@ -373,9 +484,13 @@ | |||
199 | 373 | G_CALLBACK (key_press_event), | 484 | G_CALLBACK (key_press_event), |
200 | 374 | server); | 485 | server); |
201 | 375 | 486 | ||
202 | 487 | logo_filename = get_logo_filename (gdk_screen_get_width (priv->screen)); | ||
203 | 488 | throbber_filename = get_throbber_filename (); | ||
204 | 489 | |||
205 | 376 | pixbuf = get_pixbuf (gdk_screen_get_width (priv->screen), | 490 | pixbuf = get_pixbuf (gdk_screen_get_width (priv->screen), |
206 | 377 | gdk_screen_get_height (priv->screen)); | 491 | gdk_screen_get_height (priv->screen)); |
208 | 378 | logo = gdk_pixbuf_new_from_file (logo_image, NULL); | 492 | |
209 | 493 | logo = gdk_pixbuf_new_from_file (logo_filename, NULL); | ||
210 | 379 | 494 | ||
211 | 380 | fixed = gtk_fixed_new (); | 495 | fixed = gtk_fixed_new (); |
212 | 381 | 496 | ||
213 | @@ -387,9 +502,9 @@ | |||
214 | 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, |
215 | 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); |
216 | 389 | 504 | ||
218 | 390 | if (throbber_image && throbber_frames) | 505 | if (throbber_filename && throbber_frames) |
219 | 391 | { | 506 | { |
221 | 392 | priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_image, NULL); | 507 | priv->throbber_pixbuf = gdk_pixbuf_new_from_file (throbber_filename, NULL); |
222 | 393 | 508 | ||
223 | 394 | if (priv->throbber_pixbuf != NULL) | 509 | if (priv->throbber_pixbuf != NULL) |
224 | 395 | { | 510 | { |
225 | @@ -411,6 +526,12 @@ | |||
226 | 411 | gtk_container_add (GTK_CONTAINER (priv->window), fixed); | 526 | gtk_container_add (GTK_CONTAINER (priv->window), fixed); |
227 | 412 | 527 | ||
228 | 413 | gtk_widget_show_all (priv->window); | 528 | gtk_widget_show_all (priv->window); |
229 | 529 | |||
230 | 530 | if (logo_filename) | ||
231 | 531 | g_free (logo_filename); | ||
232 | 532 | |||
233 | 533 | if (throbber_filename) | ||
234 | 534 | g_free (throbber_filename); | ||
235 | 414 | } | 535 | } |
236 | 415 | 536 | ||
237 | 416 | static void | 537 | static void |
238 | @@ -674,13 +795,13 @@ | |||
239 | 674 | signal (SIGTERM, sig_handler); | 795 | signal (SIGTERM, sig_handler); |
240 | 675 | 796 | ||
241 | 676 | if (background_image == NULL) | 797 | if (background_image == NULL) |
243 | 677 | background_image = g_strdup ("/usr/share/backgrounds/warty-final-ubuntu.png"); | 798 | background_image = get_background_filename (); |
244 | 678 | 799 | ||
245 | 679 | if (logo_image == NULL) | 800 | if (logo_image == NULL) |
247 | 680 | logo_image = g_strdup ("/usr/share/images/C/ubuntuheader.png"); | 801 | logo_image = get_logo_filename (); |
248 | 681 | 802 | ||
249 | 682 | if (throbber_image == NULL) | 803 | if (throbber_image == NULL) |
251 | 683 | throbber_image = g_strdup (DATADIR "/images/xsplash/xsplash-throbber.png"); | 804 | throbber_image = get_throbber_filename (); |
252 | 684 | 805 | ||
253 | 685 | g_debug ("background_image = %s", background_image); | 806 | g_debug ("background_image = %s", background_image); |
254 | 686 | g_debug ("logo_image = %s", logo_image); | 807 | g_debug ("logo_image = %s", logo_image); |
mt kicks ass.