diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-05-07 20:06:57 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-05-08 18:30:33 -0700 |
| commit | d0e243a2a663bf995f65ca7e72a1d20ad462f2d9 (patch) | |
| tree | 064f0b9102cbbf6e34444a080ee5f6fb467ce93a /src | |
| parent | bd9d6a215e67604acb72c210cc770381e4e8ea54 (diff) | |
Simplify
Diffstat (limited to 'src')
| -rw-r--r-- | src/cairo-tests/fill.cpp | 36 | ||||
| -rw-r--r-- | src/skia-tests/fill.cpp | 18 |
2 files changed, 26 insertions, 28 deletions
diff --git a/src/cairo-tests/fill.cpp b/src/cairo-tests/fill.cpp index cf77800..77fb351 100644 --- a/src/cairo-tests/fill.cpp +++ b/src/cairo-tests/fill.cpp @@ -133,11 +133,11 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.radius = r; ctx->shape_args.points = NULL; - cx = ctx->shape_args.center_x; - cy = ctx->shape_args.center_y; + cx = x; + cy = y; rr = r; - x1 = ctx->shape_args.center_y-r; - x2 = ctx->shape_args.center_y+r; + x1 = y-r; + x2 = y+r; break; @@ -150,11 +150,11 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*r; ctx->shape_args.points = NULL; - cx = ctx->shape_args.center_x+(ctx->shape_args.width/2); - cy = ctx->shape_args.center_y+(ctx->shape_args.height/2); + cx = x+(ctx->shape_args.width/2); + cy = y+(ctx->shape_args.height/2); rr = ctx->shape_args.height/2; - x1 = ctx->shape_args.center_y; - x2 = ctx->shape_args.center_y+ctx->shape_args.height; + x1 = y; + x2 = y+ctx->shape_args.height; break; @@ -171,10 +171,10 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.points[2][1] = -2*r; cx = x; - cy = y+2*r; + cy = y + 2*r; rr = r; - x1 = ctx->shape_args.points[0][1]; - x2 = ctx->shape_args.points[0][1]+(4*r); + x1 = y + 2*r; + x2 = y + 2*r + 4*r; break; @@ -185,17 +185,15 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); for (p = 0; p < 10; p++ ) { - int px = x + 2*r * star_points[p][0]/200.0; - int py = y + 2*r * star_points[p][1]/200.0; - ctx->shape_args.points[p][0] = px; - ctx->shape_args.points[p][1] = py; + ctx->shape_args.points[p][0] = x + 2*r * star_points[p][0]/200.0; + ctx->shape_args.points[p][1] = y + 2*r * star_points[p][1]/200.0; } - cx = ctx->shape_args.points[0][0]; - cy = ctx->shape_args.points[0][1]; + cx = x + 2*r * star_points[0][0]/200.0; + cy = y + 2*r * star_points[0][1]/200.0; rr = r; - x1 = ctx->shape_args.points[0][1]-r; - x2 = ctx->shape_args.points[0][1]+r; + x1 = x + 2*r * star_points[p][0]/200.0 - r; + x2 = y + 2*r * star_points[0][1]/200.0 + r; break; diff --git a/src/skia-tests/fill.cpp b/src/skia-tests/fill.cpp index 22bd27b..3cc6103 100644 --- a/src/skia-tests/fill.cpp +++ b/src/skia-tests/fill.cpp @@ -193,10 +193,10 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.center_y = y+r; ctx->shape_args.radius = r; - y1 = ctx->shape_args.center_y-r; - y2 = ctx->shape_args.center_y+r; - cx = ctx->shape_args.center_x; - cy = ctx->shape_args.center_y; + y1 = y; + y2 = y+2*r; + cx = x+r; + cy = y+r; rr = r; break; @@ -210,11 +210,11 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.width = (ctx->shape_args.center_x) +((ctx->shape_args.width)?ctx->shape_args.width:2*r); ctx->shape_args.height = (ctx->shape_args.center_y) + ((ctx->shape_args.height)?ctx->shape_args.height:2*r); - y1 = ctx->shape_args.center_y; - y2 = ctx->shape_args.center_y+ctx->shape_args.height/4; - cx = (ctx->shape_args.center_x+ctx->shape_args.width)/2; - cy = (ctx->shape_args.center_y+ctx->shape_args.height)/2; - rr = (ctx->shape_args.height-ctx->shape_args.center_y)/2; + y1 = y; + y2 = y + ctx->shape_args.height/4; + cx = (x + ctx->shape_args.width)/2; + cy = (y + ctx->shape_args.height)/2; + rr = (ctx->shape_args.height - y)/2; break; |