summaryrefslogtreecommitdiffstatsci
path: root/src/cairo-tests/stroke.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-tests/stroke.cpp')
-rw-r--r--src/cairo-tests/stroke.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cairo-tests/stroke.cpp b/src/cairo-tests/stroke.cpp
index 1a47271..5dd09e1 100644
--- a/src/cairo-tests/stroke.cpp
+++ b/src/cairo-tests/stroke.cpp
@@ -22,16 +22,18 @@ int
ca_test_stroke(caskbench_context_t *ctx)
{
int i, x, w, prev_w;
+ cairo_t *cr = ctx->cairo_cr;
+
x = 0;
prev_w = 0;
for (i=0; i<ctx->size; i++) {
- randomize_color (ctx->cr);
+ randomize_color (cr);
w = ((double)ctx->size*rand())/RAND_MAX + 1;
x += 4 + (prev_w + w)/2.0;
- cairo_move_to (ctx->cr, x, 10);
- cairo_line_to (ctx->cr, x, 10 + line_length);
- cairo_set_line_width (ctx->cr, w);
- cairo_stroke (ctx->cr);
+ cairo_move_to (cr, x, 10);
+ cairo_line_to (cr, x, 10 + line_length);
+ cairo_set_line_width (cr, w);
+ cairo_stroke (cr);
prev_w = w;
}
return 1;