test/lowlevel-blt-bench: Add common PDF operators
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 5 Jul 2014 08:46:00 +0000 (09:46 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 8 Jul 2014 12:07:11 +0000 (13:07 +0100)
Applications are starting to use PDF operators, so far I have spotted
multiply, dodge and lighten.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
test/lowlevel-blt-bench.c

index 99b96c0..c54fbd5 100644 (file)
@@ -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");