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.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cairo-tests/stroke.cpp b/src/cairo-tests/stroke.cpp
new file mode 100644
index 0000000..858f755
--- /dev/null
+++ b/src/cairo-tests/stroke.cpp
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <cairo.h>
+
+#include "caskbench.h"
+
+int
+ca_setup_stroke(cairo_t *cr)
+{
+ return 1;
+}
+
+void
+ca_teardown_stroke(void)
+{
+}
+
+int
+ca_test_stroke(cairo_t *cr)
+{
+ int i, x, w, prev_w;
+ x = 0;
+ prev_w = 0;
+ for (i=0; i<32; i++) {
+ randomize_color (cr);
+ w = (32.0*rand())/RAND_MAX + 1;
+ x += 4 + (prev_w + w)/2.0;
+ cairo_move_to (cr, x, 10);
+ cairo_line_to (cr, x, 70);
+ cairo_set_line_width (cr, w);
+ cairo_stroke (cr);
+ prev_w = w;
+ }
+ return 1;
+}