summaryrefslogtreecommitdiffstatsci
path: root/src/cairo-tests/mask.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-03-05 15:33:31 -0800
committerBryce Harrington <b.harrington@samsung.com>2014-03-05 15:35:01 -0800
commit83303324b218f7ee97c8ce65f71c04d35f250e97 (patch)
tree4ddb853fec92e9316dfdb81ecbf76334883fd403 /src/cairo-tests/mask.cpp
parente60b2ea8e30be4d59963fd635e091e35d114504c (diff)
mask: Improve cairo and skia mask tests
These are still not apples-to-apples since the cairo mask is not a stipple, just 50% alpha, but should be a *lot* closer now. Even though it's doing a slightly more complex mask, skia is outperforming cairo now.
Diffstat (limited to 'src/cairo-tests/mask.cpp')
-rw-r--r--src/cairo-tests/mask.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cairo-tests/mask.cpp b/src/cairo-tests/mask.cpp
index d370100..e837343 100644
--- a/src/cairo-tests/mask.cpp
+++ b/src/cairo-tests/mask.cpp
@@ -9,6 +9,7 @@ static cairo_pattern_t *mask;
int
ca_setup_mask(caskbench_context_t *ctx)
{
+ // TODO: Create a stipple mask pattern
mask = cairo_pattern_create_rgba (0, 0, 0, 0.5);
return 1;
}
@@ -25,7 +26,11 @@ ca_test_mask(caskbench_context_t *ctx)
int i;
cairo_t *cr = ctx->cairo_cr;
- for (i=0; i<ctx->size; i++)
+ for (i=0; i<ctx->size; i++) {
+ // Apply mask on a circle
+ cairo_arc (cr, 40*i, 40, 30, 0, 2*M_PI);
+ cairo_fill (cr);
cairo_mask (cr, mask);
+ }
return 1;
}