summaryrefslogtreecommitdiffstatsci
path: root/src/skia-tests/rect.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-06-24 16:13:29 -0700
committerBryce Harrington <b.harrington@samsung.com>2014-06-24 17:23:21 -0700
commit29c97b886fb6fe4d764568e21f9d45b2b08ec863 (patch)
treeef86a7f01ceddde657a97088ace88787ca3ae09f /src/skia-tests/rect.cpp
parentfb506c0829135d4ac35d0fbbdc76f19c6a58ca21 (diff)
Enable gradient fill types as random selected fill types
Also refactor the fill code from skiaDrawRandomizedShape() into its own routine.
Diffstat (limited to 'src/skia-tests/rect.cpp')
-rw-r--r--src/skia-tests/rect.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/skia-tests/rect.cpp b/src/skia-tests/rect.cpp
index efed0b3..014717f 100644
--- a/src/skia-tests/rect.cpp
+++ b/src/skia-tests/rect.cpp
@@ -28,10 +28,6 @@ sk_setup_rect(caskbench_context_t *ctx)
ctx->skia_paint->setAntiAlias(false);
ctx->skia_paint->setStrokeWidth(1);
- if (ctx->shape_defaults.fill_type != CB_FILL_RANDOM) {
- sk_set_fill_style(ctx, ctx->shape_defaults.fill_type);
- }
-
return 1;
}
@@ -59,9 +55,10 @@ sk_test_rect(caskbench_context_t *ctx)
shape.width = abs(x2 - x1);
shape.height = abs(y2 - y1);
- if (shape.fill_type == CB_FILL_RANDOM) {
- sk_set_fill_style(ctx, generate_random_fill_type());
+ if (ctx->shape_defaults.fill_type == CB_FILL_RANDOM) {
+ shape.fill_type = generate_random_fill_type();
}
+ sk_set_fill_style(ctx, &shape);
skiaRandomizePaintColor(ctx);
skiaDrawRectangle(ctx, &shape);