[cairo-commit] cairo-demo/fbdev Makefile, 1.1, 1.2 cairo-fb.c, 1.1, 1.2

Behdad Esfahbod commit at pdx.freedesktop.org
Thu Jul 28 22:48:09 PDT 2005


Committed by: behdad

Update of /cvs/cairo/cairo-demo/fbdev
In directory gabe:/tmp/cvs-serv32348

Modified Files:
	Makefile cairo-fb.c 
Log Message:
2005-07-29  Behdad Esfahbod  <behdad at behdad.org>

        * Updated to cairo 0.6.0 API.



Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-demo/fbdev/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile	30 Sep 2004 20:02:16 -0000	1.1
+++ Makefile	29 Jul 2005 05:48:07 -0000	1.2
@@ -1,10 +1,12 @@
+APPS    = cairo-fb
 
+CFLAGS  = -Wall
+LDFLAGS = -lm
 
-fbtest : fbtest.o
-	gcc `pkg-config --libs cairo` -o fbtest fbtest.o
+CFLAGS  += `pkg-config gtk+-2.0 --cflags`
+LDFLAGS += `pkg-config gtk+-2.0 --libs`
 
-fbtest.o: fbtest.c
-	gcc `pkg-config --cflags cairo` -c fbtest.c
+all: $(APPS) 
 
 clean:
-	rm *.o fbtest
+	rm -f $(APPS)

Index: cairo-fb.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/fbdev/cairo-fb.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo-fb.c	30 Sep 2004 20:02:16 -0000	1.1
+++ cairo-fb.c	29 Jul 2005 05:48:07 -0000	1.2
@@ -18,6 +18,7 @@
 	long int screensize = 0;
 	char* fbp = 0;
 	cairo_t* cr;
+	cairo_surface_t *surface;
 
 	// open the frame buffer file for reading & writing
 	fbfd = open ( "/dev/fb0", O_RDWR );
@@ -56,9 +57,9 @@
 
 	printf ("The framebuffer device was successfully mapped to memory\n");
 
-	cr = cairo_create ();
-	cairo_set_target_image (cr, fbp, CAIRO_FORMAT_ARGB32, 
+	surface = cairo_image_surface_create_for_data (fbp, CAIRO_FORMAT_ARGB32, 
 		vinfo.xres, vinfo.yres, finfo.line_length); 
+	cr = cairo_create (surface);
 	cairo_move_to (cr, 100, 100);
 	cairo_line_to (cr, 300, 300);
 	cairo_stroke (cr);




More information about the cairo-commit mailing list