[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-49-gc43c402)



The branch, master has been updated
       via  c43c40260ec072e2ad31a3b42b9d5437bea2a529 (commit)
      from  d7b18c4466a1183842d8dfeae47119cb71caa8d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/x_grid.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)


=================
 Commit Messages
=================

commit c43c40260ec072e2ad31a3b42b9d5437bea2a529
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 19:24:01 2008 +0000

    gschem: Use cairo rendering for the mesh grid
    
    Since we're grouping the stroking of all horizonal lines into a
    single command, and all vertical lines into another, this has the
    potential to be drawn quicker by the X11 server.
    
    NB: If the horizontal and vertical lines were to be grouped
        together into a single path, a large slowdown in incurred
        as cairo computes their intersections.

:100644 100644 c0f9add... 3b0ae7c... M	gschem/src/x_grid.c

=========
 Changes
=========

commit c43c40260ec072e2ad31a3b42b9d5437bea2a529
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 19:24:01 2008 +0000

    gschem: Use cairo rendering for the mesh grid
    
    Since we're grouping the stroking of all horizonal lines into a
    single command, and all vertical lines into another, this has the
    potential to be drawn quicker by the X11 server.
    
    NB: If the horizontal and vertical lines were to be grouped
        together into a single path, a large slowdown in incurred
        as cairo computes their intersections.

diff --git a/gschem/src/x_grid.c b/gschem/src/x_grid.c
index c0f9add..3b0ae7c 100644
--- a/gschem/src/x_grid.c
+++ b/gschem/src/x_grid.c
@@ -161,8 +161,6 @@ static void draw_mesh (GSCHEM_TOPLEVEL *w_current, int color,
   int next_coarse_x, next_coarse_y;
   int coarse_incr = incr * coarse_mult;
 
-  gdk_gc_set_foreground (w_current->gc, x_get_color (color));
-
   /* figure starting grid coordinates, work by taking the start
    * and end coordinates and rounding down to the nearest increment */
   x_start -= (x_start % incr);
@@ -178,6 +176,12 @@ static void draw_mesh (GSCHEM_TOPLEVEL *w_current, int color,
     if (next_coarse_y < y_start) next_coarse_y += coarse_incr;
   }
 
+  gschem_cairo_set_source_color (w_current->cr, x_color_lookup (color));
+  cairo_set_line_width (w_current->cr, 1.);
+  cairo_set_line_cap (w_current->cr, CAIRO_LINE_CAP_SQUARE);
+
+  cairo_translate (w_current->cr, 0.5, 0.5);
+
   for (j = y_start; j < y_end; j = j + incr) {
 
     /* Skip lines which will be drawn in the coarser grid */
@@ -187,8 +191,10 @@ static void draw_mesh (GSCHEM_TOPLEVEL *w_current, int color,
     }
     WORLDtoSCREEN (toplevel, x_start, j, &x1, &y1);
     WORLDtoSCREEN (toplevel, x_end,   j, &x2, &y2);
-    gdk_draw_line (w_current->drawable, w_current->gc, x1, y1, x2, y2);
+    cairo_move_to (w_current->cr, x1, y1);
+    cairo_line_to (w_current->cr, x2, y2);
   }
+  cairo_stroke (w_current->cr);
 
   for (i = x_start; i < x_end; i = i + incr) {
 
@@ -199,8 +205,12 @@ static void draw_mesh (GSCHEM_TOPLEVEL *w_current, int color,
     }
     WORLDtoSCREEN (toplevel, i, y_start, &x1, &y1);
     WORLDtoSCREEN (toplevel, i, y_end,   &x2, &y2);
-    gdk_draw_line (w_current->drawable, w_current->gc, x1, y1, x2, y2);
+    cairo_move_to (w_current->cr, x1, y1);
+    cairo_line_to (w_current->cr, x2, y2);
   }
+  cairo_stroke (w_current->cr);
+
+  cairo_translate (w_current->cr, -0.5, -0.5);
 }
 
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs