diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-05-05 18:25:26 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-05-05 18:25:26 -0700 |
| commit | 4d07d2c6fe9e77f5fecbe19528cb54cc06f0e8bd (patch) | |
| tree | b8fad0a12c1ea7bfa419942f81c6813da13ac115 | |
| parent | 398770f6d07eb5916e12545b8d223b34fa69fd6e (diff) | |
Rename centre to center
| -rw-r--r-- | src/cairo-shapes.cpp | 18 | ||||
| -rw-r--r-- | src/cairo-tests/clip.cpp | 4 | ||||
| -rw-r--r-- | src/cairo-tests/fill.cpp | 46 | ||||
| -rw-r--r-- | src/cairo-tests/stroke.cpp | 10 | ||||
| -rw-r--r-- | src/caskbench.cpp | 4 | ||||
| -rw-r--r-- | src/shapes.h | 4 | ||||
| -rw-r--r-- | src/skia-shapes.cpp | 16 | ||||
| -rw-r--r-- | src/skia-tests/clip.cpp | 20 | ||||
| -rw-r--r-- | src/skia-tests/fill.cpp | 48 | ||||
| -rw-r--r-- | src/skia-tests/stroke.cpp | 14 |
10 files changed, 92 insertions, 92 deletions
diff --git a/src/cairo-shapes.cpp b/src/cairo-shapes.cpp index 5d8673a..b50d2b4 100644 --- a/src/cairo-shapes.cpp +++ b/src/cairo-shapes.cpp @@ -36,20 +36,20 @@ cairoRandomizeColor(caskbench_context_t *ctx) void cairoDrawCircle(caskbench_context_t *ctx, shapes_t *args) { - cairo_arc (ctx->cairo_cr, args->centre_x, args->centre_y, args->radius, 0, 2*M_PI); + cairo_arc (ctx->cairo_cr, args->center_x, args->center_y, args->radius, 0, 2*M_PI); } void cairoDrawRectangle(caskbench_context_t *ctx, shapes_t *args) { - cairo_rectangle (ctx->cairo_cr, args->centre_x, args->centre_y, args->width, args->height); + cairo_rectangle (ctx->cairo_cr, args->center_x, args->center_y, args->width, args->height); } void cairoDrawTriangle(caskbench_context_t *ctx, shapes_t *args) { - cairo_move_to (ctx->cairo_cr, args->centre_x, args->centre_y+2*args->radius); + cairo_move_to (ctx->cairo_cr, args->center_x, args->center_y+2*args->radius); cairo_rel_line_to (ctx->cairo_cr, 2*args->radius, 0); cairo_rel_line_to (ctx->cairo_cr, -args->radius, -2*args->radius); } @@ -58,13 +58,13 @@ cairoDrawTriangle(caskbench_context_t *ctx, shapes_t *args) void cairoDrawStar(caskbench_context_t *ctx, shapes_t *args) { - int px = args->centre_x + 2*args->radius * star_points[0][0]/200.0; - int py = args->centre_y + 2*args->radius * star_points[0][1]/200.0; + int px = args->center_x + 2*args->radius * star_points[0][0]/200.0; + int py = args->center_y + 2*args->radius * star_points[0][1]/200.0; cairo_move_to (ctx->cairo_cr, px, py); for (int p = 1; p < 10; p++ ) { - px = args->centre_x + 2*args->radius * star_points[p][0]/200.0; - py = args->centre_y + 2*args->radius * star_points[p][1]/200.0; + px = args->center_x + 2*args->radius * star_points[p][0]/200.0; + py = args->center_y + 2*args->radius * star_points[p][1]/200.0; cairo_line_to (ctx->cairo_cr, px, py); } cairo_close_path(ctx->cairo_cr); @@ -76,8 +76,8 @@ cairoDrawRoundedRectangle (caskbench_context_t *ctx, shapes_t *args) { double h = args->height; double w = args->width; - double x = args->centre_x; - double y = args->centre_y; + double x = args->center_x; + double y = args->center_y; double r = args->radius; cairo_move_to (ctx->cairo_cr, x + r, y); cairo_arc (ctx->cairo_cr, x + w - r, y + r, r, M_PI + M_PI / 2, M_PI * 2 ); diff --git a/src/cairo-tests/clip.cpp b/src/cairo-tests/clip.cpp index 194c326..0a0fee6 100644 --- a/src/cairo-tests/clip.cpp +++ b/src/cairo-tests/clip.cpp @@ -53,8 +53,8 @@ void drawShape(caskbench_context_t *ctx,double x,double y,double clipr=0,bool is shape = ((4.0 * rand())/RAND_MAX) +1; else shape = ctx->shape_args.shape_id ; - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; ctx->shape_args.radius = isClip?clipr:r; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*(isClip?clipr:r); ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*(isClip?clipr:r); diff --git a/src/cairo-tests/fill.cpp b/src/cairo-tests/fill.cpp index 4d2138d..fdc40f0 100644 --- a/src/cairo-tests/fill.cpp +++ b/src/cairo-tests/fill.cpp @@ -51,10 +51,10 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) if(shape) { - if(!(ctx->shape_args.centre_x && ctx->shape_args.centre_y)) + if(!(ctx->shape_args.center_x && ctx->shape_args.center_y)) { - ctx->shape_args.centre_x = x = ctx->canvas_width/2; - ctx->shape_args.centre_y = y = ctx->canvas_height/2; + ctx->shape_args.center_x = x = ctx->canvas_width/2; + ctx->shape_args.center_y = y = ctx->canvas_height/2; } if(!ctx->shape_args.multi_shapes) if(!(ctx->shape_args.width && ctx->shape_args.height)) @@ -72,8 +72,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) num_y_elements = 1; r = 40; - old_x = ctx->shape_args.centre_x; - old_y = ctx->shape_args.centre_y; + old_x = ctx->shape_args.center_x; + old_y = ctx->shape_args.center_y; old_width = ctx->shape_args.width; old_height = ctx->shape_args.height; } @@ -127,16 +127,16 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.centre_y; + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.center_y; ctx->shape_args.radius = r; if(ctx->shape_args.fill_type != NULL) { if((strcmp(ctx->shape_args.fill_type,"radial-gradient")) == 0) - pattern = cairo_pattern_create_radial (ctx->shape_args.centre_x, ctx->shape_args.centre_y ,r,ctx->shape_args.centre_x, ctx->shape_args.centre_y,0 ); + pattern = cairo_pattern_create_radial (ctx->shape_args.center_x, ctx->shape_args.center_y ,r,ctx->shape_args.center_x, ctx->shape_args.center_y,0 ); else if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) - pattern = cairo_pattern_create_linear (0, ctx->shape_args.centre_y-r ,0, ctx->shape_args.centre_y+r ); + pattern = cairo_pattern_create_linear (0, ctx->shape_args.center_y-r ,0, ctx->shape_args.center_y+r ); if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); @@ -153,22 +153,22 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) case 2: // Rectangle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.centre_y; + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.center_y; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*r; ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*r; if(ctx->shape_args.fill_type != NULL) { if((strcmp(ctx->shape_args.fill_type,"radial-gradient")) == 0) - pattern = cairo_pattern_create_radial (ctx->shape_args.centre_x+(ctx->shape_args.width/2), - ctx->shape_args.centre_y+(ctx->shape_args.height/2), - ctx->shape_args.height/2, ctx->shape_args.centre_x+(ctx->shape_args.width/2), - ctx->shape_args.centre_y+(ctx->shape_args.height/2), + pattern = cairo_pattern_create_radial (ctx->shape_args.center_x+(ctx->shape_args.width/2), + ctx->shape_args.center_y+(ctx->shape_args.height/2), + ctx->shape_args.height/2, ctx->shape_args.center_x+(ctx->shape_args.width/2), + ctx->shape_args.center_y+(ctx->shape_args.height/2), 0/*ctx->shape_args.height/2 */); else if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) - pattern = cairo_pattern_create_linear (0, ctx->shape_args.centre_y, 0, - ctx->shape_args.centre_y+ctx->shape_args.height ); + pattern = cairo_pattern_create_linear (0, ctx->shape_args.center_y, 0, + ctx->shape_args.center_y+ctx->shape_args.height ); if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); @@ -189,8 +189,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.numpoints = 3; if( (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); ctx->shape_args.points[0][0] = x; @@ -227,8 +227,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) // Star if ((!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.numpoints = 10; ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); @@ -303,8 +303,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) if (!ctx->shape_args.animation && !ctx->shape_args.multi_shapes) { - ctx->shape_args.centre_x = old_x; - ctx->shape_args.centre_y = old_y; + ctx->shape_args.center_x = old_x; + ctx->shape_args.center_y = old_y; ctx->shape_args.width = old_width; ctx->shape_args.height = old_height; } diff --git a/src/cairo-tests/stroke.cpp b/src/cairo-tests/stroke.cpp index 2b2f218..3f0e144 100644 --- a/src/cairo-tests/stroke.cpp +++ b/src/cairo-tests/stroke.cpp @@ -61,16 +61,16 @@ static void drawShape(caskbench_context_t *ctx,double x,double y) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = x+r; - ctx->shape_args.centre_y = y+r; + ctx->shape_args.center_x = x+r; + ctx->shape_args.center_y = y+r; ctx->shape_args.radius = r; cairoShapes[Circle](ctx,&ctx->shape_args); break; case 2: // Rectangle - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*r; ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*r; cairoShapes[Rectangle](ctx,&ctx->shape_args); @@ -159,7 +159,7 @@ ca_test_stroke(caskbench_context_t *ctx) } else //drawStroke(ctx,NULL); - ctx->shape_args.multi_shapes?drawStroke(ctx,NULL):drawShape(ctx,ctx->shape_args.centre_x?ctx->shape_args.centre_x:100.0,ctx->shape_args.centre_y?ctx->shape_args.centre_y:100.0); + ctx->shape_args.multi_shapes?drawStroke(ctx,NULL):drawShape(ctx,ctx->shape_args.center_x?ctx->shape_args.center_x:100.0,ctx->shape_args.center_y?ctx->shape_args.center_y:100.0); return 1; } diff --git a/src/caskbench.cpp b/src/caskbench.cpp index 82e7f43..b4d6f6b 100644 --- a/src/caskbench.cpp +++ b/src/caskbench.cpp @@ -536,8 +536,8 @@ main (int argc, char *argv[]) context_init(&context, opt.size); // Command line setup for shapes - context.shape_args.centre_x = opt.x_position; - context.shape_args.centre_y = opt.y_position; + context.shape_args.center_x = opt.x_position; + context.shape_args.center_y = opt.y_position; context.shape_args.width = opt.width; context.shape_args.height = opt.height; context.shape_args.shape_id = opt.shape_id; diff --git a/src/shapes.h b/src/shapes.h index 1f045b4..b2f0bb8 100644 --- a/src/shapes.h +++ b/src/shapes.h @@ -8,8 +8,8 @@ typedef struct shapes { - double centre_x; - double centre_y; + double center_x; + double center_y; double radius; double width; double height; diff --git a/src/skia-shapes.cpp b/src/skia-shapes.cpp index 6a9ac8b..ea7c83f 100644 --- a/src/skia-shapes.cpp +++ b/src/skia-shapes.cpp @@ -29,20 +29,20 @@ skiaRandomizeColor(caskbench_context_t *ctx) void skiaDrawCircle(caskbench_context_t *ctx, shapes_t *args) { - ctx->skia_canvas->drawCircle(args->centre_x, args->centre_y, args->radius, + ctx->skia_canvas->drawCircle(args->center_x, args->center_y, args->radius, *(ctx->skia_paint)); } void skiaDrawRectangle(caskbench_context_t *ctx, shapes_t *args) { - ctx->skia_canvas->drawRectCoords(args->centre_x, args->centre_y, args->width, args->height, + ctx->skia_canvas->drawRectCoords(args->center_x, args->center_y, args->width, args->height, *(ctx->skia_paint)); } void skiaDrawTriangle(caskbench_context_t *ctx, shapes_t *args) { SkPath path; - path.moveTo(args->centre_x, args->centre_y+2*args->radius); + path.moveTo(args->center_x, args->center_y+2*args->radius); path.rLineTo(2*args->radius, 0); path.rLineTo(-args->radius, -2*args->radius); @@ -51,14 +51,14 @@ void skiaDrawTriangle(caskbench_context_t *ctx, shapes_t *args) void skiaDrawStar(caskbench_context_t *ctx, shapes_t *args) { - int px = args->centre_x + 2*args->radius * star_points[0][0]/200.0; - int py = args->centre_y + 2*args->radius * star_points[0][1]/200.0; + int px = args->center_x + 2*args->radius * star_points[0][0]/200.0; + int py = args->center_y + 2*args->radius * star_points[0][1]/200.0; SkPath path; path.moveTo(px, py); for (int p = 1; p < 10; p++ ) { - px = args->centre_x + 2*args->radius * star_points[p][0]/200.0; - py = args->centre_y + 2*args->radius * star_points[p][1]/200.0; + px = args->center_x + 2*args->radius * star_points[p][0]/200.0; + py = args->center_y + 2*args->radius * star_points[p][1]/200.0; path.lineTo(px, py); } @@ -67,7 +67,7 @@ void skiaDrawStar(caskbench_context_t *ctx, shapes_t *args) void skiaDrawRoundedRectangle (caskbench_context_t *ctx, shapes_t *args) { - args->rect.set(args->centre_x, args->centre_y, args->width, args->height); + args->rect.set(args->center_x, args->center_y, args->width, args->height); ctx->skia_canvas->drawRoundRect(args->rect, 4.0, 4.0, *(ctx->skia_paint)); } diff --git a/src/skia-tests/clip.cpp b/src/skia-tests/clip.cpp index 4e97540..dd19a37 100644 --- a/src/skia-tests/clip.cpp +++ b/src/skia-tests/clip.cpp @@ -45,19 +45,19 @@ static void drawClip(caskbench_context_t *ctx,double x,double y,double clipr=0) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = x+r; - ctx->shape_args.centre_y = y+r; + ctx->shape_args.center_x = x+r; + ctx->shape_args.center_y = y+r; ctx->shape_args.radius = r; - ctx->shape_args.path.addCircle(ctx->shape_args.centre_x, ctx->shape_args.centre_y,SkIntToScalar(clipr)); + ctx->shape_args.path.addCircle(ctx->shape_args.center_x, ctx->shape_args.center_y,SkIntToScalar(clipr)); break; case 2: // Rectangle - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; - ctx->shape_args.width = (ctx->shape_args.centre_x) +((ctx->shape_args.width)?ctx->shape_args.width:2*clipr); - ctx->shape_args.height = (ctx->shape_args.centre_y) + ((ctx->shape_args.height)?ctx->shape_args.height:2*clipr); - ctx->shape_args.path.addRect(ctx->shape_args.centre_x, ctx->shape_args.centre_y, ctx->shape_args.width, ctx->shape_args.height); + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; + ctx->shape_args.width = (ctx->shape_args.center_x) +((ctx->shape_args.width)?ctx->shape_args.width:2*clipr); + ctx->shape_args.height = (ctx->shape_args.center_y) + ((ctx->shape_args.height)?ctx->shape_args.height:2*clipr); + ctx->shape_args.path.addRect(ctx->shape_args.center_x, ctx->shape_args.center_y, ctx->shape_args.width, ctx->shape_args.height); ctx->shape_args.width = old_width; ctx->shape_args.height = old_height; break; @@ -120,8 +120,8 @@ static void drawShape(caskbench_context_t *ctx,double x,double y,double clipr=0) shape = ((4.0 * rand())/RAND_MAX) +1; else shape = ctx->shape_args.shape_id ; - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; ctx->shape_args.radius = r; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*r; ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*r; diff --git a/src/skia-tests/fill.cpp b/src/skia-tests/fill.cpp index f81a5d7..cd855bf 100644 --- a/src/skia-tests/fill.cpp +++ b/src/skia-tests/fill.cpp @@ -71,10 +71,10 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) if(shape) { - if(!(ctx->shape_args.centre_x && ctx->shape_args.centre_y)) + if(!(ctx->shape_args.center_x && ctx->shape_args.center_y)) { - ctx->shape_args.centre_x = x = ctx->canvas_width/2; - ctx->shape_args.centre_y = y = ctx->canvas_height/2; + ctx->shape_args.center_x = x = ctx->canvas_width/2; + ctx->shape_args.center_y = y = ctx->canvas_height/2; } if(!ctx->shape_args.multi_shapes) if(!(ctx->shape_args.width && ctx->shape_args.height)) @@ -131,8 +131,8 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) num_y_elements = 1; r = 40; - old_x = ctx->shape_args.centre_x; - old_y = ctx->shape_args.centre_y; + old_x = ctx->shape_args.center_x; + old_y = ctx->shape_args.center_y; } for (j=0; j<num_y_elements; j++) { @@ -187,8 +187,8 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.centre_y; + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.center_y; ctx->shape_args.radius = r; if(ctx->shape_args.fill_type != NULL) @@ -197,7 +197,7 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) { linearColors[1] = SkColorSetARGB (alpha, red, green, blue); linearColors[0] = SkColorSetARGB (200,200,200,200); - center.set(ctx->shape_args.centre_x, ctx->shape_args.centre_y); + center.set(ctx->shape_args.center_x, ctx->shape_args.center_y); shader = SkGradientShader::CreateRadial (center,r, linearColors, NULL,2, @@ -209,9 +209,9 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) linearColors[0] = SkColorSetARGB (alpha, red, green, blue); linearColors[1] = SkColorSetARGB (200,200,200,200); linearPoints[0].fX = SkIntToScalar(0); - linearPoints[0].fY = SkIntToScalar(ctx->shape_args.centre_y-r); + linearPoints[0].fY = SkIntToScalar(ctx->shape_args.center_y-r); linearPoints[1].fX = SkIntToScalar(0); - linearPoints[1].fY = SkIntToScalar(ctx->shape_args.centre_y+r); + linearPoints[1].fY = SkIntToScalar(ctx->shape_args.center_y+r); shader = SkGradientShader::CreateLinear ( linearPoints, linearColors, NULL, 2, @@ -228,10 +228,10 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) case 2: // Rectangle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.centre_y; - ctx->shape_args.width = (ctx->shape_args.centre_x) +((ctx->shape_args.width)?ctx->shape_args.width:2*r); - ctx->shape_args.height = (ctx->shape_args.centre_y) + ((ctx->shape_args.height)?ctx->shape_args.height:2*r); + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.center_y; + 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); if(ctx->shape_args.fill_type != NULL) { @@ -239,9 +239,9 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) { linearColors[1] = SkColorSetARGB (alpha, red, green, blue); linearColors[0] = SkColorSetARGB (200,200,200,200); - center.set((ctx->shape_args.centre_x+ctx->shape_args.width)/2, (ctx->shape_args.centre_y+ctx->shape_args.height)/2); + center.set((ctx->shape_args.center_x+ctx->shape_args.width)/2, (ctx->shape_args.center_y+ctx->shape_args.height)/2); - shader = SkGradientShader::CreateRadial (center, (ctx->shape_args.height-ctx->shape_args.centre_y)/2, + shader = SkGradientShader::CreateRadial (center, (ctx->shape_args.height-ctx->shape_args.center_y)/2, linearColors, NULL,2, SkShader::kClamp_TileMode, NULL); @@ -252,9 +252,9 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) linearColors[0] = SkColorSetARGB (alpha, red, green, blue); linearColors[1] = SkColorSetARGB (200,200,200,200); linearPoints[0].fX = SkIntToScalar(0); - linearPoints[0].fY = SkIntToScalar(ctx->shape_args.centre_y); + linearPoints[0].fY = SkIntToScalar(ctx->shape_args.center_y); linearPoints[1].fX = SkIntToScalar(0); - linearPoints[1].fY = SkIntToScalar(ctx->shape_args.centre_y+ctx->shape_args.height/4); + linearPoints[1].fY = SkIntToScalar(ctx->shape_args.center_y+ctx->shape_args.height/4); shader = SkGradientShader::CreateLinear ( linearPoints, linearColors, NULL, 2, @@ -273,8 +273,8 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.path.reset(); if( (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.numpoints = 3; @@ -327,8 +327,8 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.path.reset(); if( (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.numpoints = 10; ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); @@ -391,8 +391,8 @@ void drawSkiashapes(caskbench_context_t *ctx,kinetics_t *particles) if(!ctx->shape_args.animation && !ctx->shape_args.multi_shapes) { - ctx->shape_args.centre_x = old_x; - ctx->shape_args.centre_y = old_y; + ctx->shape_args.center_x = old_x; + ctx->shape_args.center_y = old_y; ctx->shape_args.width = old_width; ctx->shape_args.height = old_height; } diff --git a/src/skia-tests/stroke.cpp b/src/skia-tests/stroke.cpp index 3792af6..f2f76f8 100644 --- a/src/skia-tests/stroke.cpp +++ b/src/skia-tests/stroke.cpp @@ -49,18 +49,18 @@ static void drawShape(caskbench_context_t *ctx,double x,double y,kinetics_t *par switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = x+r; - ctx->shape_args.centre_y = y+r; + ctx->shape_args.center_x = x+r; + ctx->shape_args.center_y = y+r; ctx->shape_args.radius = r; skiaShapes[Circle](ctx,&ctx->shape_args); break; case 2: // Rectangle - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; - ctx->shape_args.width = (ctx->shape_args.centre_x) +((ctx->shape_args.width)?ctx->shape_args.width:2*r); - ctx->shape_args.height = (ctx->shape_args.centre_y) + ((ctx->shape_args.height)?ctx->shape_args.height:2*r); + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; + 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); skiaShapes[Rectangle](ctx,&ctx->shape_args); ctx->shape_args.width = old_width; ctx->shape_args.height = old_height; @@ -168,6 +168,6 @@ sk_test_stroke(caskbench_context_t *ctx) } /* Static clip */ else - ctx->shape_args.multi_shapes?draw_stroke(ctx,ctx->skia_canvas,NULL):drawShape(ctx,ctx->shape_args.centre_x?ctx->shape_args.centre_x:100,ctx->shape_args.centre_y?ctx->shape_args.centre_y:100); + ctx->shape_args.multi_shapes?draw_stroke(ctx,ctx->skia_canvas,NULL):drawShape(ctx,ctx->shape_args.center_x?ctx->shape_args.center_x:100,ctx->shape_args.center_y?ctx->shape_args.center_y:100); return 1; } |