diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-04-24 00:14:09 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-04-24 00:14:09 -0700 |
| commit | e391ae2091be6d736dee7734b0a9e4c2beaddef5 (patch) | |
| tree | ea5989326b67963bc80c7272b54d2f44b0a4a232 /src/skia-tests/stroke.cpp | |
| parent | cef0f06a4d8105d31af57f3dace28d4e92cbbeb8 (diff) | |
Add cairoRandomizeColor and skiaRandomizeColor
Diffstat (limited to 'src/skia-tests/stroke.cpp')
| -rw-r--r-- | src/skia-tests/stroke.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/skia-tests/stroke.cpp b/src/skia-tests/stroke.cpp index 6340480..3792af6 100644 --- a/src/skia-tests/stroke.cpp +++ b/src/skia-tests/stroke.cpp @@ -109,11 +109,7 @@ static void draw_stroke(caskbench_context_t *ctx,SkCanvas* canvas,kinetics_t* pa for (i=0; i<num_x_elements; i++) { x = particles?particles->x : i * element_spacing; ctx->skia_paint->setStrokeCap((SkPaint::Cap)(i % 5)); - 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 ); + skiaRandomizeColor(ctx); drawShape(ctx, x,y); } } @@ -164,11 +160,7 @@ sk_test_stroke(caskbench_context_t *ctx) ctx->skia_canvas->drawColor(SK_ColorWHITE); for (i = 0; i < num_particles; i++) { kinetics_update(&particles[i], 0.3); - 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 ); + skiaRandomizeColor(ctx); //draw_stroke(ctx,ctx->skia_canvas,&particles[i]); drawShape(ctx,particles[i].x,particles[i].y,&particles[i]); } |