[cairo-commit] cairo-demo/svgspacewar ChangeLog, 1.5, 1.6 svgspacewar.c, 1.4, 1.5

Carl Worth commit at pdx.freedesktop.org
Wed Jun 22 10:34:27 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo-demo/svgspacewar
In directory gabe:/tmp/cvs-serv17453

Modified Files:
	ChangeLog svgspacewar.c 
Log Message:

        From Nigel Tao <nigel.tao at myrealbox.com>:

        * svgspacewar.c: (draw_energy_bar), (draw_ship_body): Port
        fill+stroke code forward to work with 0.5.0.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/svgspacewar/ChangeLog,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ChangeLog	22 Jun 2005 17:25:36 -0000	1.5
+++ ChangeLog	22 Jun 2005 17:34:25 -0000	1.6
@@ -1,5 +1,12 @@
 2005-06-22  Carl Worth  <cworth at cworth.org>
 
+	From Nigel Tao <nigel.tao at myrealbox.com>:
+
+	* svgspacewar.c: (draw_energy_bar), (draw_ship_body): Port
+	fill+stroke code forward to work with 0.5.0.
+
+2005-06-22  Carl Worth  <cworth at cworth.org>
+
 	* svgspacewar.c: (scale_for_aspect_ratio): Put the clipping back,
 	(it actually was needed). But call cairo_clip before cairo_scale
 	in order to get the fast-path clipping.

Index: svgspacewar.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/svgspacewar/svgspacewar.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svgspacewar.c	22 Jun 2005 17:25:36 -0000	1.4
+++ svgspacewar.c	22 Jun 2005 17:34:25 -0000	1.5
@@ -429,7 +429,6 @@
 
   cairo_rectangle (cr, 0, -5, p->energy / 5, 10);
 
-  cairo_save (cr);
   cairo_pattern_t *pat =
     cairo_pattern_create_linear (0, 0, SHIP_MAX_ENERGY / 5, 0);
   cairo_pattern_add_color_stop_rgba (pat, 0,
@@ -441,9 +440,8 @@
 				     alpha);
 
   cairo_set_source (cr, pat);
-  cairo_fill (cr);
+  cairo_fill_preserve (cr);
   cairo_pattern_destroy (pat);
-  cairo_restore (cr);
 
   cairo_set_source_rgb (cr, 0, 0, 0);
   cairo_stroke (cr);
@@ -457,12 +455,10 @@
 {
   if (p->is_hit)
     {
-      cairo_save (cr);
       cairo_set_source_rgba (cr, p->primary_color.r, p->primary_color.g,
 			     p->primary_color.b, 0.5);
       cairo_arc (cr, 0, 0, SHIP_RADIUS / FIXED_POINT_SCALE_FACTOR, 0, TWO_PI);
       cairo_stroke (cr);
-      cairo_restore (cr);
     }
 
   cairo_save (cr);
@@ -487,7 +483,6 @@
 	}
     }
 
-  cairo_save (cr);
   cairo_move_to (cr, 0, -33);
   cairo_curve_to (cr, 2, -33, 3, -34, 4, -35);
   cairo_curve_to (cr, 8, -10, 6, 15, 15, 15);
@@ -503,7 +498,6 @@
   cairo_curve_to (cr, -6, 15, -8, -10, -4, -35);
   cairo_curve_to (cr, -3, -34, -2, -33, 0, -33);
 
-  cairo_save (cr);
   cairo_pattern_t *pat =
     cairo_pattern_create_linear (-30.0, -30.0, 30.0, 30.0);
   cairo_pattern_add_color_stop_rgba (pat, 0,
@@ -514,14 +508,12 @@
 				     p->secondary_color.b, 1);
 
   cairo_set_source (cr, pat);
-  cairo_fill (cr);
+  cairo_fill_preserve (cr);
   cairo_pattern_destroy (pat);
-  cairo_restore (cr);
 
   cairo_set_source_rgb (cr, 0, 0, 0);
   cairo_stroke (cr);
   cairo_restore (cr);
-  cairo_restore (cr);
 }
 
 //------------------------------------------------------------------------------




More information about the cairo-commit mailing list