From 790e7492bdb5c0c77c53ae769f0d408b04d5c99b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 5 Jul 2014 09:46:00 +0100 Subject: test/lowlevel-blt-bench: Add common PDF operators Applications are starting to use PDF operators, so far I have spotted multiply, dodge and lighten. Signed-off-by: Chris Wilson --- test/lowlevel-blt-bench.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index 99b96c03..c54fbd52 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -63,22 +63,32 @@ static const struct format { }; static const struct op { + int value; const char *name; } ops[] = { - [PictOpClear] = { "Clear" }, - [PictOpSrc] = { "Src" }, - [PictOpDst] = { "Dst" }, - [PictOpOver] = { "Over" }, - [PictOpOverReverse] = { "OverReverse" }, - [PictOpIn] = { "In" }, - [PictOpInReverse] = { "InReverse" }, - [PictOpOut] = { "Out" }, - [PictOpOutReverse] = { "OutReverse" }, - [PictOpAtop] = { "Atop" }, - [PictOpAtopReverse] = { "AtopReverse" }, - [PictOpXor] = { "Xor" }, - [PictOpAdd] = { "Add" }, - [PictOpSaturate] = { "Saturate" }, + { PictOpClear, "Clear" }, + { PictOpSrc, "Src" }, + { PictOpDst, "Dst" }, + { PictOpOver, "Over" }, + { PictOpOverReverse, "OverReverse" }, + { PictOpIn, "In" }, + { PictOpInReverse, "InReverse" }, + { PictOpOut, "Out" }, + { PictOpOutReverse, "OutReverse" }, + { PictOpAtop, "Atop" }, + { PictOpAtopReverse, "AtopReverse" }, + { PictOpXor, "Xor" }, + { PictOpAdd, "Add" }, + { PictOpSaturate, "Saturate" }, + { PictOpMultiply, "Multiply" }, + { PictOpScreen, "Screen" }, + { PictOpOverlay, "Overlay" }, + { PictOpDarken, "Darken" }, + { PictOpLighten, "Lighten" }, + { PictOpColorDodge, "Dodge" }, + { PictOpColorBurn, "Burn" }, + { PictOpHardLight, "HardLight" }, + { PictOpSoftLight, "SoftLight" }, }; static Picture source_pixmap(struct test_display *t, struct test_target *target, int format) @@ -340,6 +350,8 @@ static void bench_source(struct test *t, enum target target, int op, int src) fprintf(stdout, "%28s with %s: ", source[src].name, ops[op].name); fflush(stdout); + op = ops[op].value; + ref = _bench_source(&t->ref, target, op, src, 1000); if (ref < 0) { fprintf(stdout, "SKIP\n"); @@ -403,6 +415,8 @@ static void bench_mask(struct test *t, enum target target, int op, int src, int source[src].name, source[mask].name, ops[op].name); fflush(stdout); + op = ops[op].value; + ref = _bench_mask(&t->ref, target, op, src, mask, 1000); if (ref < 0) { fprintf(stdout, "SKIP\n"); -- cgit v1.2.3