summaryrefslogtreecommitdiff
path: root/packages/gpe-bootsplash/files/cairofix.patch
blob: ff6e288cbcabd0d67487e568c5a063fc180c261f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- /tmp/splash.c	2005-10-06 14:45:21.463681488 +0200
+++ gpe-bootsplash-1.14/splash.c	2005-10-06 14:45:29.480462752 +0200
@@ -118,7 +118,8 @@
 
   tty = open ("/dev/tty0", O_RDWR);
   if (tty < 0)
-    perror ("open");
+    tty = open ("/dev/vc/0", O_RDWR);
+  if (tty < 0)    perror ("open");
   else
     {
       write (tty, cursoff, strlen (cursoff));
@@ -176,6 +177,7 @@
   double scale, xscale, yscale;
   svg_cairo_status_t status;
   int width, height;
+  cairo_surface_t *surface;
     
   status = svg_cairo_create (&svgc);
   if (status) 
@@ -201,17 +203,17 @@
   xsize = (double)width * scale + 0.5;
   ysize = (double)height * scale + 0.5;
 
-  cr = cairo_create ();
-  cairo_scale (cr, scale, scale);
 
   pix = malloc (xsize * ysize * 4);
   stride = xsize * 4;
   has_alpha = TRUE;
   
-  cairo_set_target_image (cr, pix, CAIRO_FORMAT_ARGB32, xsize, ysize, xsize * 4);
-
+  surface = cairo_image_surface_create_for_data(pix, CAIRO_FORMAT_ARGB32, xsize, ysize, stride);
+  cr = cairo_create (surface);
+  cairo_scale (cr, scale, scale);
+  
   /* XXX: This probably doesn't need to be here (eventually) */
-  cairo_set_rgb_color (cr, 1, 1, 1);
+  cairo_set_source_rgb (cr, 1, 1, 1);
 
   svg_cairo_render (svgc, cr);