[cairo-commit] cairo-5c/examples animate.5c,1.2,1.3

Keith Packard commit at pdx.freedesktop.org
Tue Dec 14 23:04:52 PST 2004


Committed by: keithp

Update of /cvs/cairo/cairo-5c/examples
In directory gabe:/tmp/cvs-serv29582/examples

Modified Files:
	animate.5c 
Log Message:
2004-12-14  Keith Packard  <keithp at keithp.com>

	* cairo-5c.h:
	* gtk.c: (gtk_repaint_timeout), (dirty_x), (disable_x), (enable_x):
	* init.c: (nickle_init):
	* surface.c: (enable_cairo_5c), (disable_cairo_5c),
	(do_Cairo_enable), (do_Cairo_disable):
	Add enable/disable to take advantage of double buffering for
	smooth animation.
	
	* examples/animate.5c:
	Use enable/disable to smooth this animation out


Index: animate.5c
===================================================================
RCS file: /cvs/cairo/cairo-5c/examples/animate.5c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- animate.5c	14 Dec 2004 08:34:27 -0000	1.2
+++ animate.5c	15 Dec 2004 07:04:50 -0000	1.3
@@ -43,7 +43,7 @@
 void transform (foreign cr, real t)
 {
     translate (cr, 50, 50);
-    rotate (cr, t * pi / 30);
+    rotate (cr, t * pi / 60);
 }
 
 void animate (foreign cr, mutex l, int n, int m)
@@ -52,6 +52,7 @@
     for (;;)
     {
 	Mutex::acquire (l);
+	disable (cr);
 	save (cr);
 	translate (cr, n * 100, m * 100);
 	set_rgb_color (cr, 1, 1, 1);
@@ -60,6 +61,7 @@
 	transform (cr, t);
 	picture (cr);
 	restore (cr);
+	enable (cr);
 	Mutex::release (l);
 	sleep (100);
 	t += n + m + 1;




More information about the cairo-commit mailing list