From 69c194043ce3cbd1ea54133609f876b3244dfc9c Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Wed, 5 Mar 2014 19:52:59 -0800 Subject: Use same random numbers for colorization This makes most of the tests display the same for both cairo and skia. --- src/skia-tests/stroke.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/skia-tests/stroke.cpp') diff --git a/src/skia-tests/stroke.cpp b/src/skia-tests/stroke.cpp index 3a9ba67..142dd01 100644 --- a/src/skia-tests/stroke.cpp +++ b/src/skia-tests/stroke.cpp @@ -24,11 +24,17 @@ sk_teardown_stroke(void) int sk_test_stroke(caskbench_context_t *ctx) { + unsigned char red, green, blue, alpha; int i, x, w, prev_w; x = 0; prev_w = 0; for (i=0; isize; i++) { - ctx->skia_paint->setColor(rand()); + red = int( 255 * (double)rand()/RAND_MAX ); + green = int( 255 * (double)rand()/RAND_MAX ); + blue = int( 255 * (double)rand()/RAND_MAX ); + alpha = int( 255 * (double)rand()/RAND_MAX ); + ctx->skia_paint->setARGB(alpha, red, green, blue); + w = ((double)ctx->size*rand())/RAND_MAX + 1; x += 4 + (prev_w + w)/2.0; ctx->skia_paint->setStrokeWidth(w); -- cgit v1.3.1-4-g156e