[cairo-commit] cairo-demo/sproing ChangeLog, 1.10, 1.11 sproing.c, 1.9, 1.10

Carl Worth commit at pdx.freedesktop.org
Tue May 17 08:03:32 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo-demo/sproing
In directory gabe:/tmp/cvs-serv5477

Modified Files:
	ChangeLog sproing.c 
Log Message:

        * sproing.c: (begin_paint), (draw_spline_grid),
        (draw_spline_spiral), (draw_wall): Update to the latest cairo API
        changes.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/sproing/ChangeLog,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ChangeLog	18 Apr 2005 06:45:22 -0000	1.10
+++ ChangeLog	17 May 2005 15:03:30 -0000	1.11
@@ -1,3 +1,9 @@
+2005-05-17  Carl Worth  <cworth at cworth.org>
+
+	* sproing.c: (begin_paint), (draw_spline_grid),
+	(draw_spline_spiral), (draw_wall): Update to the latest cairo API
+	changes.
+
 2005-04-18  Carl Worth  <cworth at cworth.org>
 
 	* sproing.c: (draw_ball), (draw_star): Track removal of

Index: sproing.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/sproing/sproing.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sproing.c	18 Apr 2005 06:45:22 -0000	1.9
+++ sproing.c	17 May 2005 15:03:30 -0000	1.10
@@ -305,8 +305,11 @@
 {
     Display *dpy;
     Drawable xid;
+    Visual *visual;
     GdkDrawable *drawable;
     gint x_offset, y_offset;
+    gint width, height;
+    cairo_surface_t *surface;
     cairo_t *cr;
   
     if (GDK_IS_WINDOW (window))
@@ -317,9 +320,12 @@
 
     dpy = gdk_x11_drawable_get_xdisplay (drawable);
     xid = gdk_x11_drawable_get_xid (drawable);
-
-    cr = cairo_create ();
-    cairo_set_target_drawable (cr, dpy, xid);
+    gdk_drawable_get_size (drawable, &width, &height);
+    visual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual (drawable));
+    surface = cairo_xlib_surface_create (dpy, xid, visual,
+					 width, height);
+    cr = cairo_create (surface);
+    cairo_surface_destroy (surface);
 
     if (GDK_IS_WINDOW (window))
 	cairo_translate (cr, -x_offset, -y_offset);
@@ -442,7 +448,7 @@
 
   cr = begin_paint (widget->window);
 
-  cairo_set_rgb_color (cr, 0, 0, 0);
+  cairo_set_source_rgb (cr, 0, 0, 0);
   cairo_set_line_width (cr, 1.0);
 
   cairo_new_path (cr);
@@ -486,7 +492,7 @@
 
   cr = begin_paint (widget->window);
 
-  cairo_set_rgb_color (cr, 0, 0, 0);
+  cairo_set_source_rgb (cr, 0, 0, 0);
   cairo_set_line_width (cr, 0.8);
 
   cairo_new_path (cr);
@@ -519,9 +525,8 @@
 
   cairo_save (cr);
   {
-    cairo_rectangle (cr, 0, 0, WALL_X, WALL_Y);
-    cairo_set_rgb_color (cr, 0.8, 0.7, 0.7);
-    cairo_fill (cr);
+    cairo_set_source_rgb (cr, 0.8, 0.7, 0.7);
+    cairo_paint (cr);
   }
   cairo_restore (cr);
 




More information about the cairo-commit mailing list