From b97546a2c39600d28be46d7a5c9d1b251dd22b04 Mon Sep 17 00:00:00 2001 From: suyambulingamrm Date: Thu, 26 Jun 2014 19:46:49 +0530 Subject: Issue #105. Modify tests to support random fill options. --- src/cairo-tests/rect.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/cairo-tests/rect.cpp') diff --git a/src/cairo-tests/rect.cpp b/src/cairo-tests/rect.cpp index e25488c..52babd8 100644 --- a/src/cairo-tests/rect.cpp +++ b/src/cairo-tests/rect.cpp @@ -46,18 +46,13 @@ ca_test_rect(caskbench_context_t *ctx) shape.width = abs(x2 - x1); shape.height = abs(y2 - y1); - cairoRandomizeColor(ctx); - cairoDrawRectangle(ctx, &shape); - switch (ctx->shape_defaults.fill_type) { - case CB_FILL_NONE: - cairo_stroke(ctx->cairo_cr); - break; - case CB_FILL_SOLID: - cairo_fill(ctx->cairo_cr); - break; - default: - break; + if (ctx->shape_defaults.fill_type == CB_FILL_RANDOM) { + shape.fill_type = generate_random_fill_type(); } + ca_set_fill_style(ctx, &shape); + + shape.shape_type = CB_SHAPE_RECTANGLE; + cairoDrawRandomizedShape(ctx,&shape); } return 1; -- cgit v1.3.1-4-g156e