cairo_move_to (cr, x1, y1); cairo_line_to (cr, sx1, sy1); cairo_pattern_t *mask = cairo_pattern_create_rgba (.5,.5,.5,1); cairo_save (cr); cairo_mask (cr,mask); cairo_stroke (cr); cairo_restore (cr); cairo_pattern_destroy (mask);