From: Jean-Philippe Orsini Date: Tue, 27 Mar 2012 10:28:22 +0000 (+0000) Subject: performance improvement, factorize cairo line styling X-Git-Tag: v0.8.0.5~464 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=b558a7525745bbf0e5ef5030de6418cfcb30fe3d performance improvement, factorize cairo line styling --- diff --git a/src/graph.c b/src/graph.c index f40e442..a3701bc 100644 --- a/src/graph.c +++ b/src/graph.c @@ -178,9 +178,7 @@ static void draw_sensor_curve(struct psensor *s, s->color->f_red, s->color->f_green, s->color->f_blue); - cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND); - cairo_set_line_width(cr, 1); - + for (i = 0; i < s->values_max_length; i++) { int x, y, t; double v; @@ -314,6 +312,10 @@ graph_update(struct psensor **sensors, if (bt && et) { sensor_cur = sensors; + + cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND); + cairo_set_line_width(cr, 1); + while (*sensor_cur) { struct psensor *s = *sensor_cur;