diff options
author | Peter Harris <peter.harris@hummingbird.com> | 2007-10-29 11:42:17 -0400 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2010-11-23 14:46:02 -0500 |
commit | 21f0e4650f50a9639109d6b67d8ca356b53b5e07 (patch) | |
tree | 4a4f03beb231e7895b6807410343c67112c11b0a | |
parent | e7917bbec06e5c8e17f07b0eb833602b33111f08 (diff) |
-rw-r--r-- | x11perf.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -130,6 +130,8 @@ static char *foreground = NULL; static char *background = NULL; static char *ddbackground = NULL; static int clips = 0; +static Bool clipmask = False; +static Pixmap clipmaskpix; static int numSubWindows = 7; static unsigned long subWindows[] = {4, 16, 25, 50, 75, 100, 200, 0}; @@ -491,6 +493,7 @@ usage(void) " -fg the foreground color to use", " -bg the background color to use", " -clips <default> default number of clip windows per test", +" -clipmask perform tests with a clipmask", " -ddbg the background color to use for DoubleDash", " -rop <rop0 rop1 ...> use the given rops to draw (default = GXcopy)", " -pm <pm0 pm1 ...> use the given planemasks to draw (default = ~0)", @@ -755,6 +758,29 @@ CreatePerfGCs(XParms xp, int func, unsigned long pm) gcvbg.function = func; gcvddfg.function = func; gcvddbg.function = func; + + if (clipmask) { + XGCValues gcv; + GC tempGC; + + clipmaskpix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, 1); + gcv.foreground = 0; + tempGC = XCreateGC(xp->d, clipmaskpix, GCForeground, &gcv); + XFillRectangle(xp->d, clipmaskpix, tempGC, 0,0,WIDTH,HEIGHT); + + XSetForeground(xp->d, tempGC, 1); + XFillArc(xp->d, clipmaskpix, tempGC, 100, 100, WIDTH-200, HEIGHT-200, 0, 360*64); + XFillArc(xp->d, clipmaskpix, tempGC, 25, 25, 100, 100, 0, 360*64); + XFillArc(xp->d, clipmaskpix, tempGC, 25, HEIGHT-125, 100, 100, 0, 360*64); + XFillArc(xp->d, clipmaskpix, tempGC, WIDTH-125, 25, 100, 100, 0, 360*64); + XFillArc(xp->d, clipmaskpix, tempGC, WIDTH-125, HEIGHT-125, 100, 100, 0, 360*64); + + XFreeGC(xp->d, tempGC); + gcvfg.clip_mask = clipmaskpix; + gcvbg.clip_mask = clipmaskpix; + gcvddfg.clip_mask = clipmaskpix; + gcvddbg.clip_mask = clipmaskpix; + } if (func == GXxor) { /* Make test look good visually if possible */ @@ -774,15 +800,19 @@ CreatePerfGCs(XParms xp, int func, unsigned long pm) gcvddbg.background = fg; } xp->fggc = XCreateGC(xp->d, xp->w, + (clipmask ? GCClipMask : 0) | GCForeground | GCBackground | GCGraphicsExposures | GCFunction | GCPlaneMask, &gcvfg); xp->bggc = XCreateGC(xp->d, xp->w, + (clipmask ? GCClipMask : 0) | GCForeground | GCBackground | GCGraphicsExposures | GCFunction | GCPlaneMask, &gcvbg); xp->ddfggc = XCreateGC(xp->d, xp->w, + (clipmask ? GCClipMask : 0) | GCForeground | GCBackground | GCGraphicsExposures | GCFunction | GCPlaneMask, &gcvddfg); xp->ddbggc = XCreateGC(xp->d, xp->w, + (clipmask ? GCClipMask : 0) | GCForeground | GCBackground | GCGraphicsExposures | GCFunction | GCPlaneMask, &gcvddbg); } @@ -795,6 +825,8 @@ DestroyPerfGCs(XParms xp) XFreeGC(xp->d, xp->bggc); XFreeGC(xp->d, xp->ddfggc); XFreeGC(xp->d, xp->ddbggc); + if (clipmask) + XFreePixmap(xp->d, clipmaskpix); } static unsigned long @@ -978,6 +1010,8 @@ main(int argc, char *argv[]) foundOne = True; } else if (strcmp (argv[i], "-sync") == 0) { synchronous = True; + } else if (strcmp (argv[i], "-clipmask") == 0) { + clipmask = True; } else if (strcmp (argv[i], "-pack") == 0) { xparms.pack = True; } else if (strcmp (argv[i], "-draw") == 0) { |