summaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-06-17 18:12:30 -0700
committerBryce Harrington <b.harrington@samsung.com>2014-06-17 18:15:38 -0700
commitcb2cd9b7c3893e4b6ef55599b2ddcaef6456ad4c (patch)
tree4b4bb717a8fc5c723d625a881e2ff147d960e35f /src
parentf5ff6a9191cc3af345b4dd7eae31fb599212caab (diff)
Drop --multi-shape
Only the stroke test uses this, but stroke needs rewritten anyway.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-tests/stroke.cpp9
-rw-r--r--src/caskbench.cpp6
-rw-r--r--src/shapes.h1
-rw-r--r--src/skia-tests/stroke.cpp16
4 files changed, 13 insertions, 19 deletions
diff --git a/src/cairo-tests/stroke.cpp b/src/cairo-tests/stroke.cpp
index c950917..ff445b8 100644
--- a/src/cairo-tests/stroke.cpp
+++ b/src/cairo-tests/stroke.cpp
@@ -87,7 +87,7 @@ static void drawShape(caskbench_context_t *ctx,double x,double y)
}
}
-void drawStroke(caskbench_context_t *ctx,kinetics_t *particles)
+void draw_stroke(caskbench_context_t *ctx, kinetics_t *particles)
{
int i, r,j;
int w, h;
@@ -127,13 +127,12 @@ ca_test_stroke(caskbench_context_t *ctx)
for (i = 0; i < num_particles; i++) {
kinetics_update(&particles[i], 0.1);
- drawStroke(ctx,&particles[i]);
+ draw_stroke(ctx, &particles[i]);
}
}
+ } else {
+ draw_stroke(ctx, NULL);
}
- else
- //drawStroke(ctx,NULL);
- ctx->shape_defaults.multi_shapes?drawStroke(ctx,NULL):drawShape(ctx,ctx->shape_defaults.x?ctx->shape_defaults.x:100.0,ctx->shape_defaults.y?ctx->shape_defaults.y:100.0);
return 1;
}
diff --git a/src/caskbench.cpp b/src/caskbench.cpp
index 17e49fc..a981380 100644
--- a/src/caskbench.cpp
+++ b/src/caskbench.cpp
@@ -47,7 +47,6 @@ typedef struct _caskbench_options {
int animation;
char *stock_image_path;
int stroke_width;
- int multi_shapes;
int cap_style;
int join_style;
int dash_style;
@@ -236,10 +235,6 @@ process_options(caskbench_options_t *opt, int argc, char *argv[])
{"stroke-width", '\0', POPT_ARG_INT, &opt->stroke_width, 0,
"Line width for stroked test objects",
NULL},
- // TODO: Crashes
- {"multi-shapes", 'm', POPT_ARG_INT, &opt->multi_shapes, 0,
- "Enable multiple shapes in supporting tests",
- NULL},
#if 0
{"cap-style", 'C', POPT_ARG_INT, &opt->cap_style, 0,
"Line ending style for stroked test objects",
@@ -373,7 +368,6 @@ shape_defaults_init(shapes *shape_defaults, caskbench_options_t *opt)
shape_defaults->fill_color = convertToColorValue(opt->fill_color);
shape_defaults->stroke_color = convertToColorValue(opt->stroke_color);
shape_defaults->stroke_width = opt->stroke_width;
- shape_defaults->multi_shapes = opt->multi_shapes;
shape_defaults->animation = opt->animation;
shape_defaults->stroke_width = opt->stroke_width;
shape_defaults->cap_style = opt->cap_style;
diff --git a/src/shapes.h b/src/shapes.h
index 156110d..3ecc86c 100644
--- a/src/shapes.h
+++ b/src/shapes.h
@@ -52,7 +52,6 @@ typedef struct shapes
uint32_t stroke_color;
int animation;
int stroke_width;
- int multi_shapes;
int dash_style;
int cap_style;
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;
}