diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-06-17 18:12:30 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-06-17 18:15:38 -0700 |
| commit | cb2cd9b7c3893e4b6ef55599b2ddcaef6456ad4c (patch) | |
| tree | 4b4bb717a8fc5c723d625a881e2ff147d960e35f /src/skia-tests/stroke.cpp | |
| parent | f5ff6a9191cc3af345b4dd7eae31fb599212caab (diff) | |
Drop --multi-shape
Only the stroke test uses this, but stroke needs rewritten anyway.
Diffstat (limited to 'src/skia-tests/stroke.cpp')
| -rw-r--r-- | src/skia-tests/stroke.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/skia-tests/stroke.cpp b/src/skia-tests/stroke.cpp index 8c7a4e5..6449f7d 100644 --- a/src/skia-tests/stroke.cpp +++ b/src/skia-tests/stroke.cpp @@ -72,8 +72,10 @@ static void drawShape(caskbench_context_t *ctx,double x,double y,kinetics_t *par ctx->skia_canvas->flush(); } -static void draw_stroke(caskbench_context_t *ctx,SkCanvas* canvas,kinetics_t* particles) { - int i,j,x,y; +static void draw_stroke(caskbench_context_t *ctx, kinetics_t* particles) { + int i, j, x, y; + SkCanvas* canvas = ctx->skia_canvas; + for (j=0; j<num_y_elements; j++) { y = particles?particles->y : j * element_spacing; ctx->skia_paint->setStrokeJoin((SkPaint::Join)(j % 5)); @@ -81,7 +83,7 @@ static void draw_stroke(caskbench_context_t *ctx,SkCanvas* canvas,kinetics_t* pa x = particles?particles->x : i * element_spacing; ctx->skia_paint->setStrokeCap((SkPaint::Cap)(i % 5)); skiaRandomizePaintColor(ctx); - drawShape(ctx, x,y); + drawShape(ctx, x, y); } } } @@ -114,7 +116,7 @@ int sk_test_stroke(caskbench_context_t *ctx) { /* Animation */ - if(ctx->shape_defaults.animation) + if (ctx->shape_defaults.animation) { int num_particles = ctx->shape_defaults.animation; particles = (kinetics_t *) malloc (sizeof (kinetics_t) * num_particles); @@ -131,10 +133,10 @@ sk_test_stroke(caskbench_context_t *ctx) drawShape(ctx,particles[i].x,particles[i].y,&particles[i]); } } + } else { + draw_stroke(ctx, NULL); } - /* Static clip */ - else - ctx->shape_defaults.multi_shapes?draw_stroke(ctx,ctx->skia_canvas,NULL):drawShape(ctx,ctx->shape_defaults.x?ctx->shape_defaults.x:100,ctx->shape_defaults.y?ctx->shape_defaults.y:100); + return 1; } |