From ee11b04c48b57b74beacd0a905fbc96a86c75931 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Fri, 14 Nov 2003 16:48:58 +0000 Subject: XFree86 4.3.0.1 --- Xmark | 9 +- bitmaps.h | 7 +- do_arcs.c | 166 +++++++++++--------------------- do_blt.c | 194 ++++++++++++++++---------------------- do_complex.c | 49 +++++----- do_dots.c | 19 ++-- do_lines.c | 64 +++++-------- do_movewin.c | 72 ++++++-------- do_rects.c | 26 +++-- do_segs.c | 63 +++++-------- do_simple.c | 37 ++++---- do_tests.c | 269 ++++++++++++++++++++++------------------------------ do_text.c | 187 +++++++++++++++++++++++++++--------- do_traps.c | 160 ++++++++++++++++++++++++++++--- do_tris.c | 75 +++++++-------- do_valgc.c | 19 ++-- do_windows.c | 114 +++++++++++----------- x11pcomp.cpp | 8 +- x11perf.c | 287 +++++++++++++++++++++++++------------------------------- x11perf.h | 195 ++++++++++++++++++++++++++++++++++++-- x11perf.man | 7 +- x11perfcomp.man | 7 +- 22 files changed, 1109 insertions(+), 925 deletions(-) diff --git a/Xmark b/Xmark index 43e8228..50056d3 100644 --- a/Xmark +++ b/Xmark @@ -8,6 +8,9 @@ # Usage: Xmark datafile # ############################################################ +# $XFree86: xc/programs/x11perf/Xmark.sh,v 1.3 2001/01/17 23:45:10 dawes Exp $ +# +# # CHANGE HISTORY: # # X11perfcompDR -- Creates a Digital Review compatible breakdown of @@ -587,10 +590,10 @@ cat > awkfile.$$ <<'EOS' weight[name] = 0; # clear to avoid double counting sumofweights += thisweight; printf("%d:",thisweight); # output in new format - printf("%9.1f\n",rate); + printf("%.1f\n",rate); } END{ - printf("sumof:%9.1f\n",sumofweights); + printf("sumof:%.1f\n",sumofweights); } EOS @@ -600,7 +603,7 @@ rm -f awkfile.$$ # cleanup # calculate the weighted average sumofweights=`grep sumof rates.$$ | awk -F: ' { print($2) }' - ` -if [ "$sumofweights" -ne "4566" ] +if [ "$sumofweights" != "4566.0" ] then echo "ERROR: sum of weights =$sumofweights, not equal to 4566.0;" echo "ABORTING!" diff --git a/bitmaps.h b/bitmaps.h index 50555b2..de5806d 100644 --- a/bitmaps.h +++ b/bitmaps.h @@ -21,11 +21,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/bitmaps.h,v 1.4 2001/01/17 23:45:11 dawes Exp $ */ /* Set fill style (if any) to a bitmap or tile */ -extern void SetFillStyle(/* xp, p */); -/* - XParms xp; - Parms p; -*/ +extern void SetFillStyle(XParms xp, Parms p); diff --git a/do_arcs.c b/do_arcs.c index a55eb91..9f2b422 100644 --- a/do_arcs.c +++ b/do_arcs.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_arcs.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" @@ -29,11 +30,8 @@ static GC pgc; #define DegreesToX(degrees) (degrees * 64) -static void GenerateCircles(xp, p, partialArcs, ddashed) - XParms xp; - Parms p; - Bool partialArcs; - Bool ddashed; +static void +GenerateCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed) { int i; int rows; /* Number of rows filled in current column */ @@ -93,29 +91,23 @@ static void GenerateCircles(xp, p, partialArcs, ddashed) } } -int InitCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCircles(XParms xp, Parms p, int reps) { GenerateCircles(xp, p, False, False); return reps; } -int InitPartCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPartCircles(XParms xp, Parms p, int reps) { GenerateCircles(xp, p, True, False); return reps; } -int InitChordPartCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitChordPartCircles(XParms xp, Parms p, int reps) { GenerateCircles(xp, p, True, False); XSetArcMode(xp->d, xp->bggc, ArcChord); @@ -124,10 +116,8 @@ int InitChordPartCircles(xp, p, reps) } -int InitSlicePartCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitSlicePartCircles(XParms xp, Parms p, int reps) { GenerateCircles(xp, p, True, False); XSetArcMode(xp->d, xp->bggc, ArcPieSlice); @@ -136,11 +126,7 @@ int InitSlicePartCircles(xp, p, reps) } static void -GenerateWideCircles (xp, p, partialArcs, ddashed) - XParms xp; - Parms p; - Bool partialArcs; - Bool ddashed; +GenerateWideCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed) { int size; @@ -161,28 +147,22 @@ GenerateWideCircles (xp, p, partialArcs, ddashed) } } -int InitWideCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideCircles(XParms xp, Parms p, int reps) { GenerateWideCircles (xp, p, False, False); return reps; } -int InitPartWideCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPartWideCircles(XParms xp, Parms p, int reps) { GenerateWideCircles (xp, p, True, False); return reps; } -int InitDashedCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDashedCircles(XParms xp, Parms p, int reps) { char dashes[2]; @@ -197,10 +177,8 @@ int InitDashedCircles(xp, p, reps) return reps; } -int InitWideDashedCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDashedCircles(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -220,10 +198,8 @@ int InitWideDashedCircles(xp, p, reps) return reps; } -int InitDoubleDashedCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDoubleDashedCircles(XParms xp, Parms p, int reps) { char dashes[2]; @@ -238,10 +214,8 @@ int InitDoubleDashedCircles(xp, p, reps) return reps; } -int InitWideDoubleDashedCircles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDoubleDashedCircles(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -261,11 +235,8 @@ int InitWideDoubleDashedCircles(xp, p, reps) return reps; } -static void GenerateEllipses(xp, p, partialArcs, ddashed) - XParms xp; - Parms p; - int partialArcs; - Bool ddashed; +static void +GenerateEllipses(XParms xp, Parms p, int partialArcs, Bool ddashed) { int size; int half; @@ -336,30 +307,24 @@ static void GenerateEllipses(xp, p, partialArcs, ddashed) } } -int InitEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitEllipses(XParms xp, Parms p, int reps) { GenerateEllipses(xp, p, False, False); return reps; } -int InitPartEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPartEllipses(XParms xp, Parms p, int reps) { GenerateEllipses(xp, p, True, False); return reps; } -int InitChordPartEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitChordPartEllipses(XParms xp, Parms p, int reps) { GenerateEllipses(xp, p, True, False); XSetArcMode(xp->d, xp->bggc, ArcChord); @@ -368,10 +333,8 @@ int InitChordPartEllipses(xp, p, reps) } -int InitSlicePartEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitSlicePartEllipses(XParms xp, Parms p, int reps) { GenerateEllipses(xp, p, True, False); XSetArcMode(xp->d, xp->bggc, ArcPieSlice); @@ -381,11 +344,7 @@ int InitSlicePartEllipses(xp, p, reps) static void -GenerateWideEllipses (xp, p, partialArcs, ddashed) - XParms xp; - Parms p; - Bool partialArcs; - Bool ddashed; +GenerateWideEllipses(XParms xp, Parms p, Bool partialArcs, Bool ddashed) { int size; @@ -406,28 +365,22 @@ GenerateWideEllipses (xp, p, partialArcs, ddashed) } -int InitWideEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideEllipses(XParms xp, Parms p, int reps) { GenerateWideEllipses(xp, p, False, False); return reps; } -int InitPartWideEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPartWideEllipses(XParms xp, Parms p, int reps) { GenerateWideEllipses(xp, p, True, False); return reps; } -int InitDashedEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDashedEllipses(XParms xp, Parms p, int reps) { char dashes[2]; @@ -442,10 +395,8 @@ int InitDashedEllipses(xp, p, reps) return reps; } -int InitWideDashedEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDashedEllipses(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -465,10 +416,8 @@ int InitWideDashedEllipses(xp, p, reps) return reps; } -int InitDoubleDashedEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDoubleDashedEllipses(XParms xp, Parms p, int reps) { char dashes[2]; @@ -483,10 +432,8 @@ int InitDoubleDashedEllipses(xp, p, reps) return reps; } -int InitWideDoubleDashedEllipses(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDoubleDashedEllipses(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -506,10 +453,8 @@ int InitWideDoubleDashedEllipses(xp, p, reps) return reps; } -void DoArcs(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoArcs(XParms xp, Parms p, int reps) { int i; @@ -523,13 +468,12 @@ void DoArcs(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void DoFilledArcs(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoFilledArcs(XParms xp, Parms p, int reps) { int i; @@ -543,12 +487,12 @@ void DoFilledArcs(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndArcs(xp, p) - XParms xp; - Parms p; +void +EndArcs(XParms xp, Parms p) { free(arcs); } diff --git a/do_blt.c b/do_blt.c index 5182816..541c61b 100644 --- a/do_blt.c +++ b/do_blt.c @@ -1,4 +1,4 @@ -/* $Xorg: do_blt.c,v 1.4 2000/11/30 12:16:31 pookie Exp $ */ +/* $Xorg: do_blt.c,v 1.3 2000/08/17 19:54:09 cpqbld Exp $ */ /***************************************************************************** Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_blt.c,v 1.9 2001/11/03 21:59:20 dawes Exp $ */ #include "x11perf.h" #include @@ -34,7 +35,8 @@ static XSegment *segsa, *segsb; #define NegMod(x, y) ((y) - (((-x)-1) % (7)) - 1) -void InitBltLines() +static void +InitBltLines(void) { int i, x, y; @@ -61,20 +63,16 @@ void InitBltLines() } } -int InitScroll(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitScroll(XParms xp, Parms p, int reps) { InitBltLines(); XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin); return reps; } -void DoScroll(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoScroll(XParms xp, Parms p, int reps) { int i, size, x, y, xorg, yorg, delta; @@ -110,27 +108,24 @@ void DoScroll(xp, p, reps) x = xorg; } } + CheckAbort (); } } -void MidScroll(xp, p) - XParms xp; - Parms p; +void +MidScroll(XParms xp, Parms p) { XClearWindow(xp->d, xp->w); XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin); } -void EndScroll(xp, p) - XParms xp; - Parms p; +void +EndScroll(XParms xp, Parms p) { } -static void InitCopyLocations(xp, p, reps) - XParms xp; - Parms p; - int reps; +static void +InitCopyLocations(XParms xp, Parms p, int reps) { int x1, y1, x2, y2, size, i; int xinc, yinc; @@ -189,20 +184,16 @@ static void InitCopyLocations(xp, p, reps) } -int InitCopyWin(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCopyWin(XParms xp, Parms p, int reps) { (void) InitScroll(xp, p, reps); InitCopyLocations(xp, p, reps); return reps; } -int InitCopyPix(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCopyPix(XParms xp, Parms p, int reps) { GC pixgc; (void) InitCopyWin(xp, p, reps); @@ -216,10 +207,8 @@ int InitCopyPix(xp, p, reps) return reps; } -Bool InitGetImage(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitGetImage(XParms xp, Parms p, int reps) { (void) InitCopyWin(xp, p, reps); @@ -233,21 +222,16 @@ Bool InitGetImage(xp, p, reps) return reps; } -Bool InitPutImage(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPutImage(XParms xp, Parms p, int reps) { if(!InitGetImage(xp, p, reps))return False; XClearWindow(xp->d, xp->w); return reps; } -static void CopyArea(xp, p, reps, src, dst) - XParms xp; - Parms p; - int reps; - Drawable src, dst; +static void +CopyArea(XParms xp, Parms p, int reps, Drawable src, Drawable dst) { int i, size; XSegment *sa, *sb; @@ -262,47 +246,38 @@ static void CopyArea(xp, p, reps, src, dst) sb->x2, sb->y2, size, size, sb->x1, sb->y1); XCopyArea(xp->d, src, dst, xp->fggc, sb->x1, sb->y1, size, size, sb->x2, sb->y2); + CheckAbort (); } } -void DoCopyWinWin(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCopyWinWin(XParms xp, Parms p, int reps) { CopyArea(xp, p, reps, xp->w, xp->w); } -void DoCopyPixWin(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCopyPixWin(XParms xp, Parms p, int reps) { CopyArea(xp, p, reps, pix, xp->w); } -void DoCopyWinPix(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCopyWinPix(XParms xp, Parms p, int reps) { CopyArea(xp, p, reps, xp->w, pix); xp->p = pix; /* HardwareSync will now sync on pixmap */ } -void DoCopyPixPix(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCopyPixPix(XParms xp, Parms p, int reps) { CopyArea(xp, p, reps, pix, pix); xp->p = pix; /* HardwareSync will now sync on pixmap */ } -void DoGetImage(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoGetImage(XParms xp, Parms p, int reps) { int i, size; XSegment *sa, *sb; @@ -338,13 +313,12 @@ rectangle. (void) XGetSubImage(xp->d, xp->w, sb->x1, sb->y1, size, size, xp->planemask, ZPixmap, image, sb->x2, sb->y2); */ + CheckAbort (); } } -void DoPutImage(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoPutImage(XParms xp, Parms p, int reps) { int i, size; XSegment *sa, *sb; @@ -359,49 +333,57 @@ void DoPutImage(xp, p, reps) sb->x2, sb->y2, sb->x2, sb->y2, size, size); XPutImage(xp->d, xp->w, xp->fggc, image, sb->x1, sb->y1, sb->x2, sb->y2, size, size); + CheckAbort (); } } #ifdef MITSHM #include +#ifndef Lynx #include #include +#else +#include +#include +#endif #include static XImage shm_image; static XShmSegmentInfo shm_info; static int haderror; -static int (*origerrorhandler)(); -shmerrorhandler(d,e) -Display *d; -XErrorEvent *e; +static int (*origerrorhandler)(Display *, XErrorEvent *); + +static int +shmerrorhandler(Display *d, XErrorEvent *e) { haderror++; - if(e->error_code==BadAccess)fprintf(stderr,"failed to attach shared memory\n"); - else (*origerrorhandler)(d,e); + if(e->error_code==BadAccess) { + fprintf(stderr,"failed to attach shared memory\n"); + return 0; + } else + return (*origerrorhandler)(d,e); } -int InitShmPutImage (xp, p, reps) - XParms xp; - Parms p; - int reps; + +int +InitShmPutImage(XParms xp, Parms p, int reps) { int image_size; if(!InitGetImage(xp, p, reps))return False; if (!XShmQueryExtension(xp->d)) { /* - * Clean up here because cleanup function is not called if this + * Clean up here because cleanup function is not called if this * function fails */ - if (image) - XDestroyImage(image); - image = NULL; - free(segsa); - free(segsb); - return False; - } + if (image) + XDestroyImage(image); + image = NULL; + free(segsa); + free(segsb); + return False; + } XClearWindow(xp->d, xp->w); shm_image = *image; image_size = image->bytes_per_line * image->height; @@ -467,10 +449,8 @@ int InitShmPutImage (xp, p, reps) return reps; } -void DoShmPutImage(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoShmPutImage(XParms xp, Parms p, int reps) { int i, size; XSegment *sa, *sb; @@ -485,14 +465,13 @@ void DoShmPutImage(xp, p, reps) sb->x2, sb->y2, sb->x2, sb->y2, size, size, False); XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image, sb->x1, sb->y1, sb->x2, sb->y2, size, size, False); + CheckAbort (); } } -void EndShmPutImage(xp, p) - XParms xp; - Parms p; +void +EndShmPutImage(XParms xp, Parms p) { - void EndGetImage(); EndGetImage (xp, p); XShmDetach (xp->d, &shm_info); @@ -506,25 +485,22 @@ void EndShmPutImage(xp, p) #endif -void MidCopyPix(xp, p) - XParms xp; - Parms p; +void +MidCopyPix(XParms xp, Parms p) { XClearWindow(xp->d, xp->w); } -void EndCopyWin(xp, p) - XParms xp; - Parms p; +void +EndCopyWin(XParms xp, Parms p) { EndScroll(xp, p); free(segsa); free(segsb); } -void EndCopyPix(xp, p) - XParms xp; - Parms p; +void +EndCopyPix(XParms xp, Parms p) { EndCopyWin(xp, p); XFreePixmap(xp->d, pix); @@ -534,18 +510,15 @@ void EndCopyPix(xp, p) xp->p = (Pixmap)0; } -void EndGetImage(xp, p) - XParms xp; - Parms p; +void +EndGetImage(XParms xp, Parms p) { EndCopyWin(xp, p); if (image) XDestroyImage(image); } -Bool InitCopyPlane(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCopyPlane(XParms xp, Parms p, int reps) { XGCValues gcv; GC pixgc; @@ -571,10 +544,8 @@ Bool InitCopyPlane(xp, p, reps) return reps; } -void DoCopyPlane(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCopyPlane(XParms xp, Parms p, int reps) { int i, size; XSegment *sa, *sb; @@ -589,6 +560,7 @@ void DoCopyPlane(xp, p, reps) sb->x2, sb->y2, size, size, sb->x1, sb->y1, 1); XCopyPlane(xp->d, pix, xp->w, xp->fggc, sb->x1, sb->y1, size, size, sb->x2, sb->y2, 1); + CheckAbort (); } } diff --git a/do_complex.c b/do_complex.c index c1ef532..faa073f 100644 --- a/do_complex.c +++ b/do_complex.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_complex.c,v 1.9 2002/05/31 18:46:09 dawes Exp $ */ #include "x11perf.h" @@ -29,16 +30,15 @@ SOFTWARE. static XPoint *points; static GC pgc; -extern double sin(); -extern double cos(); -extern double tan(); -extern double sqrt(); -#define PI 3.14159265357989 +#include +#if defined(QNX4) || defined(__CYGWIN__) || defined(__UNIXOS2__) +#define PI 3.14159265358979323846 +#else +#define PI M_PI +#endif /* QNX4 */ -int InitComplexPoly(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitComplexPoly(XParms xp, Parms p, int reps) { int i, j, numPoints; int x, y; @@ -97,10 +97,8 @@ int InitComplexPoly(xp, p, reps) return reps; } -void DoComplexPoly(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoComplexPoly(XParms xp, Parms p, int reps) { int i, j; XPoint *curPoint; @@ -116,20 +114,18 @@ void DoComplexPoly(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndComplexPoly(xp, p) - XParms xp; - Parms p; +void +EndComplexPoly(XParms xp, Parms p) { free(points); } -int InitGeneralPoly (xp,p,reps) - XParms xp; - Parms p; - int reps; +int +InitGeneralPoly(XParms xp, Parms p, int reps) { int i, j, numPoints; int nsides; @@ -140,7 +136,7 @@ int InitGeneralPoly (xp,p,reps) pgc = xp->fggc; size = p->special; - nsides = (int) p->font; + nsides = (long) p->font; phi = 0.0; delta = 2.0 * PI / ((double) nsides); phiinc = delta / 10.0; @@ -174,18 +170,16 @@ int InitGeneralPoly (xp,p,reps) return reps; } -void DoGeneralPoly(xp,p,reps) - XParms xp; - Parms p; - int reps; +void +DoGeneralPoly(XParms xp, Parms p, int reps) { int i, j; int nsides; int mode; XPoint *curPoint; - nsides = (int) p->font; - mode = (int) p->bfont; + nsides = (long) p->font; + mode = (long) p->bfont; for (i = 0; i != reps; i++) { curPoint = points; for (j = 0; j != p->objects; j++) { @@ -197,5 +191,6 @@ void DoGeneralPoly(xp,p,reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } diff --git a/do_dots.c b/do_dots.c index 8aab1a2..aa6702b 100644 --- a/do_dots.c +++ b/do_dots.c @@ -21,16 +21,15 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_dots.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" static XPoint *points; static GC pgc; -int InitDots(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDots(XParms xp, Parms p, int reps) { int i; @@ -45,10 +44,8 @@ int InitDots(xp, p, reps) return reps; } -void DoDots(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoDots(XParms xp, Parms p, int reps) { int i; @@ -58,12 +55,12 @@ void DoDots(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndDots(xp, p) - XParms xp; - Parms p; +void +EndDots(XParms xp, Parms p) { free(points); } diff --git a/do_lines.c b/do_lines.c index a12c759..95dd810 100644 --- a/do_lines.c +++ b/do_lines.c @@ -21,16 +21,15 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_lines.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" static XPoint *points; static GC pgc; -static void GenerateLines(xp, p, ddashed) - XParms xp; - Parms p; - Bool ddashed; +static void +GenerateLines(XParms xp, Parms p, Bool ddashed) { int size; int half; /* Half of width if wide line */ @@ -39,7 +38,7 @@ static void GenerateLines(xp, p, ddashed) int x, y; /* Next point */ int xdir, ydir; /* Which direction x, y are going */ int bigxdir; - int x1, y1; /* offsets to compute next point from current */ + int x1 = 0, y1 = 0; /* offsets to compute next point from current */ int phase; /* how far into 0..4*(size_1) we are */ float phasef; /* how far we are in real numbers */ float phaseinc; /* how much to increment phasef at each segment */ @@ -164,20 +163,15 @@ static void GenerateLines(xp, p, ddashed) } } -int InitLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitLines(XParms xp, Parms p, int reps) { GenerateLines(xp, p, False); return reps; } -static int GenerateWideLines(xp, p, reps, ddashed) - XParms xp; - Parms p; - int reps; - Bool ddashed; +static int +GenerateWideLines(XParms xp, Parms p, int reps, Bool ddashed) { int size; @@ -200,18 +194,14 @@ static int GenerateWideLines(xp, p, reps, ddashed) return reps; } -int InitWideLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideLines(XParms xp, Parms p, int reps) { return GenerateWideLines(xp, p, reps, False); } -int InitDashedLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDashedLines(XParms xp, Parms p, int reps) { char dashes[2]; @@ -226,10 +216,8 @@ int InitDashedLines(xp, p, reps) return reps; } -int InitWideDashedLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDashedLines(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -249,10 +237,8 @@ int InitWideDashedLines(xp, p, reps) return reps; } -int InitDoubleDashedLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDoubleDashedLines(XParms xp, Parms p, int reps) { char dashes[2]; @@ -267,10 +253,8 @@ int InitDoubleDashedLines(xp, p, reps) return reps; } -int InitWideDoubleDashedLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideDoubleDashedLines(XParms xp, Parms p, int reps) { int size; XGCValues gcv; @@ -290,10 +274,8 @@ int InitWideDoubleDashedLines(xp, p, reps) return reps; } -void DoLines(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoLines(XParms xp, Parms p, int reps) { int i; @@ -308,12 +290,12 @@ void DoLines(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndLines(xp, p) - XParms xp; - Parms p; +void +EndLines(XParms xp, Parms p) { free(points); } diff --git a/do_movewin.c b/do_movewin.c index 034b51b..06d1803 100644 --- a/do_movewin.c +++ b/do_movewin.c @@ -1,4 +1,4 @@ -/* $Xorg: do_movewin.c,v 1.5 2000/11/30 12:19:00 pookie Exp $ */ +/* $Xorg: do_movewin.c,v 1.4 2000/08/17 19:54:09 cpqbld Exp $ */ /***************************************************************************** Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_movewin.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" @@ -28,16 +29,14 @@ static Window *children; static XPoint *positions; static Window cover; static int rows; -static x_offset, y_offset; /* Private global data for DoMoveWindows */ +static int x_offset, y_offset; /* Private global data for DoMoveWindows */ static int xmax, ymax; -static delta1; /* Private global data for DoResizeWindows */ +static int delta1; /* Private global data for DoResizeWindows */ #define STACK (4*(HEIGHT-10)/CHILDSIZE) -int InitMoveWindows(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitMoveWindows(XParms xp, Parms p, int reps) { int i = 0; @@ -65,10 +64,8 @@ int InitMoveWindows(xp, p, reps) return reps; } -void DoMoveWindows(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoMoveWindows(XParms xp, Parms p, int reps) { int i, j; @@ -83,22 +80,19 @@ void DoMoveWindows(xp, p, reps) XMoveWindow(xp->d, children[j], positions[j].x + x_offset, positions[j].y + y_offset); } + CheckAbort (); } } -void EndMoveWindows(xp, p) - XParms xp; - Parms p; +void +EndMoveWindows(XParms xp, Parms p) { - XDestroySubwindows(xp->d, xp->w); free(children); free(positions); } -void DoResizeWindows(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoResizeWindows(XParms xp, Parms p, int reps) { int i, j, delta2; @@ -110,13 +104,12 @@ void DoResizeWindows(xp, p, reps) XResizeWindow(xp->d, children[j], CHILDSIZE+delta2, CHILDSIZE-delta2); } + CheckAbort (); } } -int InitCircWindows(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCircWindows(XParms xp, Parms p, int reps) { int i; int pos; @@ -135,31 +128,28 @@ int InitCircWindows(xp, p, reps) return reps; } -void DoCircWindows(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoCircWindows(XParms xp, Parms p, int reps) { int i, j; for (i = 0; i != reps; i++) + { for (j = 0; j != p->objects; j++) XCirculateSubwindows (xp->d, xp->w, RaiseLowest); + CheckAbort (); + } } -void EndCircWindows(xp, p) - XParms xp; - Parms p; +void +EndCircWindows(XParms xp, Parms p) { - XDestroySubwindows(xp->d, xp->w); free(children); } -int InitMoveTree(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitMoveTree(XParms xp, Parms p, int reps) { int i = 0; @@ -191,10 +181,8 @@ int InitMoveTree(xp, p, reps) return reps; } -void DoMoveTree(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoMoveTree(XParms xp, Parms p, int reps) { int i; @@ -206,12 +194,12 @@ void DoMoveTree(xp, p, reps) if (x_offset + xmax > WIDTH) x_offset = 0; XMoveWindow(xp->d, cover, x_offset, y_offset); + CheckAbort (); } } -void EndMoveTree(xp, p) - XParms xp; - Parms p; +void +EndMoveTree(XParms xp, Parms p) { XDestroyWindow(xp->d, cover); free(children); diff --git a/do_rects.c b/do_rects.c index e380b74..9c99f2b 100644 --- a/do_rects.c +++ b/do_rects.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_rects.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" #include "bitmaps.h" @@ -28,10 +29,8 @@ SOFTWARE. static XRectangle *rects; static GC pgc; -int InitRectangles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitRectangles(XParms xp, Parms p, int reps) { int i; int size = p->special; @@ -86,10 +85,8 @@ int InitRectangles(xp, p, reps) return reps; } -void DoRectangles(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoRectangles(XParms xp, Parms p, int reps) { int i; @@ -99,13 +96,12 @@ void DoRectangles(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void DoOutlineRectangles (xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoOutlineRectangles(XParms xp, Parms p, int reps) { int i; @@ -115,12 +111,12 @@ void DoOutlineRectangles (xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndRectangles(xp, p) - XParms xp; - Parms p; +void +EndRectangles(XParms xp, Parms p) { free(rects); } diff --git a/do_segs.c b/do_segs.c index 718751d..8606217 100644 --- a/do_segs.c +++ b/do_segs.c @@ -21,23 +21,22 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_segs.c,v 1.5 2001/01/17 23:45:11 dawes Exp $ */ #include "x11perf.h" static XSegment *segments; static GC pgc; -static void GenerateSegments(xp, p, ddashed) - XParms xp; - Parms p; - Bool ddashed; +static void +GenerateSegments(XParms xp, Parms p, Bool ddashed) { int size; int half; int i; int rows; /* Number of rows filled in current column */ int x, y; /* base of square to draw in */ - int x1, y1, x2, y2; /* offsets into square */ + int x1=0, y1=0, x2=0, y2=0; /* offsets into square */ int phase; /* how far into 0..8*size we are */ int phaseinc; /* how much to increment phase at each segment */ int size8; /* 8 * size */ @@ -168,19 +167,15 @@ static void GenerateSegments(xp, p, ddashed) } } -int InitSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitSegments(XParms xp, Parms p, int reps) { GenerateSegments(xp, p, False); return reps; } -int InitDashedSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDashedSegments(XParms xp, Parms p, int reps) { char dashes[2]; @@ -197,10 +192,8 @@ int InitDashedSegments(xp, p, reps) return reps; } -int InitDoubleDashedSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDoubleDashedSegments(XParms xp, Parms p, int reps) { char dashes[2]; @@ -217,10 +210,8 @@ int InitDoubleDashedSegments(xp, p, reps) return reps; } -int InitHorizSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitHorizSegments(XParms xp, Parms p, int reps) { int size; int half; @@ -275,10 +266,8 @@ int InitHorizSegments(xp, p, reps) return reps; } -int InitWideHorizSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideHorizSegments(XParms xp, Parms p, int reps) { int size; @@ -294,10 +283,8 @@ int InitWideHorizSegments(xp, p, reps) } -int InitVertSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitVertSegments(XParms xp, Parms p, int reps) { int size; int half; @@ -354,10 +341,8 @@ int InitVertSegments(xp, p, reps) return reps; } -int InitWideVertSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitWideVertSegments(XParms xp, Parms p, int reps) { int size; @@ -373,10 +358,8 @@ int InitWideVertSegments(xp, p, reps) } -void DoSegments(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoSegments(XParms xp, Parms p, int reps) { int i; @@ -390,12 +373,12 @@ void DoSegments(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndSegments(xp, p) - XParms xp; - Parms p; +void +EndSegments(XParms xp, Parms p) { free(segments); } diff --git a/do_simple.c b/do_simple.c index 358f27f..934303b 100644 --- a/do_simple.c +++ b/do_simple.c @@ -1,4 +1,4 @@ -/* $Xorg: do_simple.c,v 1.5 2000/11/30 12:20:45 pookie Exp $ */ +/* $Xorg: do_simple.c,v 1.4 2000/08/17 19:54:09 cpqbld Exp $ */ /***************************************************************************** Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_simple.c,v 1.6 2001/11/03 21:59:20 dawes Exp $ */ #ifndef VMS #include @@ -33,23 +34,20 @@ SOFTWARE. static Atom XA_PK_TEMP; static Window root; -void DoNoOp(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoNoOp(XParms xp, Parms p, int reps) { int i; for (i = 0; i != reps; i++) { XNoOp(xp->d); + CheckAbort (); } } -void DoGetAtom(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoGetAtom(XParms xp, Parms p, int reps) { char *atom; int i; @@ -57,13 +55,12 @@ void DoGetAtom(xp, p, reps) for (i = 0; i != reps; i++) { atom = XGetAtomName (xp->d, 1); XFree(atom); /* fix XBUG 6480 */ + CheckAbort (); } } -void DoQueryPointer(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoQueryPointer(XParms xp, Parms p, int reps) { int i; Window w; @@ -72,13 +69,12 @@ void DoQueryPointer(xp, p, reps) for (i = 0; i != reps; i++) { XQueryPointer (xp->d, xp->w, &w, &w, &x, &x, &x, &x, &m); + CheckAbort (); } } -int InitGetProperty(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitGetProperty(XParms xp, Parms p, int reps) { long foo[4]; @@ -94,10 +90,8 @@ int InitGetProperty(xp, p, reps) return reps; } -void DoGetProperty(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoGetProperty(XParms xp, Parms p, int reps) { int i, status; int actual_format; @@ -111,6 +105,7 @@ void DoGetProperty(xp, p, reps) xp->d, xp->w, XA_PK_TEMP, 0, 4, False, AnyPropertyType, &actual_type, &actual_format, &actual_length, &bytes_remaining, &prop); + CheckAbort (); XFree(prop); } } diff --git a/do_tests.c b/do_tests.c index c938de9..ad429b7 100644 --- a/do_tests.c +++ b/do_tests.c @@ -21,165 +21,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_tests.c,v 1.10 2002/05/13 06:23:35 keithp Exp $ */ #include "x11perf.h" -extern void DoGetAtom(); -extern void DoQueryPointer(); - -extern void DoNoOp(); - -extern Bool InitGetProperty(); -extern void DoGetProperty(); - -extern Bool InitRectangles(); -extern void DoRectangles(); -extern void DoOutlineRectangles(); -extern void EndRectangles(); - -extern Bool InitGC(); -extern void DoChangeGC(); -extern void EndGC(); - -extern Bool InitSegments(); -extern Bool InitHorizSegments(); -extern Bool InitVertSegments(); -extern Bool InitWideHorizSegments(); -extern Bool InitWideVertSegments(); -extern Bool InitDashedSegments(); -extern Bool InitDoubleDashedSegments(); -extern void DoSegments(); -extern void EndSegments(); - -extern Bool InitLines(); -extern Bool InitWideLines(); -extern Bool InitDashedLines(); -extern Bool InitWideDashedLines(); -extern Bool InitDoubleDashedLines(); -extern Bool InitWideDoubleDashedLines(); -extern void DoLines(); -extern void EndLines(); - - -extern Bool InitCircles(); -extern Bool InitPartCircles(); -extern Bool InitWideCircles(); -extern Bool InitPartWideCircles(); -extern Bool InitDashedCircles(); -extern Bool InitWideDashedCircles(); -extern Bool InitDoubleDashedCircles(); -extern Bool InitWideDoubleDashedCircles(); -extern Bool InitChordPartCircles(); -extern Bool InitSlicePartCircles(); - -extern Bool InitEllipses(); -extern Bool InitPartEllipses(); -extern Bool InitWideEllipses(); -extern Bool InitPartWideEllipses(); -extern Bool InitDashedEllipses(); -extern Bool InitWideDashedEllipses(); -extern Bool InitDoubleDashedEllipses(); -extern Bool InitWideDoubleDashedEllipses(); -extern Bool InitChordPartEllipses(); -extern Bool InitSlicePartEllipses(); -extern void DoArcs(); -extern void DoFilledArcs(); -extern void EndArcs(); - -extern Bool InitDots(); -extern void DoDots(); -extern void EndDots(); - -extern Bool InitCreate(); -extern void CreateChildren(); -extern void DestroyChildren(); -extern void EndCreate(); - -extern Bool InitMap(); -extern void MapParents(); -extern void UnmapParents(); - -extern Bool InitDestroy(); -extern void DestroyParents(); -extern void RenewParents(); - -extern Bool InitMoveWindows(); -extern void DoMoveWindows(); -extern void EndMoveWindows(); - -extern void DoResizeWindows(); - -extern Bool InitCircWindows(); -extern void DoCircWindows(); -extern void EndCircWindows(); - -extern Bool InitMoveTree(); -extern void DoMoveTree(); -extern void EndMoveTree(); - -extern Bool InitText(); -extern Bool InitText16(); -extern void DoText(); -extern void DoText16(); -extern void DoImageText(); -extern void DoImageText16(); -extern void DoPolyText(); -extern void DoPolyText16(); -extern void ClearTextWin(); -extern void EndText(); -extern void EndText16(); - -extern Bool InitCopyPlane(); -extern void DoCopyPlane(); -extern void EndCopyPlane(); - -extern Bool InitPopups(); -extern void DoPopUps(); -extern void EndPopups(); - -extern Bool InitScroll(); -extern void DoScroll(); -extern void MidScroll(); -extern void EndScroll(); - -extern Bool InitCopyWin(); -extern Bool InitCopyPix(); -extern void DoCopyWinWin(); -extern void DoCopyPixWin(); -extern void DoCopyWinPix(); -extern void DoCopyPixPix(); -extern void MidCopyPix(); -extern void EndCopyWin(); -extern void EndCopyPix(); - -extern Bool InitGetImage(); -extern void DoGetImage(); -extern void EndGetImage(); - -extern Bool InitPutImage(); -extern void DoPutImage(); - -#ifdef MITSHM -extern Bool InitShmPutImage(); -extern void DoShmPutImage(); -extern void EndShmPutImage(); -#endif - -extern Bool InitTriangles(); -extern void DoTriangles(); -extern void EndTriangles(); - -extern Bool InitTrapezoids(); -extern void DoTrapezoids(); -extern void EndTrapezoids(); - -extern Bool InitComplexPoly(); -extern void DoComplexPoly(); -extern void EndComplexPoly(); - -extern Bool InitGeneralPoly(); -extern void DoGeneralPoly(); - /* * some test must be done a certain multiple of times. That multiple is * in the second half of the products below. You can edit the multiplier, @@ -945,6 +790,40 @@ Test test[] = { InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids, V1_4FEATURE, ROP, 0, {2, 300, "escherknot", NULL, FillTiled}}, +#ifdef XRENDER + {"-aatrap1", "Fill 1x1 aa trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 1 }}, + {"-aatrap10", "Fill 10x10 aa trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 10 }}, + {"-aatrap100", "Fill 100x100 aa trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 100 }}, + {"-aatrap300", "Fill 300x300 aa trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 300 }}, + {"-addaatrap1", "Fill 1x1 aa pre-added trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 1, "add" }}, + {"-addaatrap10", "Fill 10x10 aa pre-added trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 10, "add" }}, + {"-addaatrap100", "Fill 100x100 aa pre-added trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 100, "add" }}, + {"-addaatrap300", "Fill 300x300 aa pre-added trapezoid", NULL, + InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids, + V1_5FEATURE, NONROP, 0, + {POLY, 300, "add" }}, +#endif {"-complex10", "Fill 10-pixel/side complex polygon", NULL, InitComplexPoly, DoComplexPoly, NullProc, EndComplexPoly, V1_2ONLY, ROP, 0, @@ -1060,6 +939,80 @@ Test test[] = { {30, False, "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", NULL}}, +#ifdef XFT + {"-aa10text", "Char in 80-char aa line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=true:rgba=0:pixelsize=10", NULL}}, + {"-aa24text", "Char in 30-char aa line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=true:rgba=0:pixelsize=24", NULL}}, + {"-aaftext", "Char in 80-char aa line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=true:rgba=0:pixelsize=12", NULL}}, + {"-a10text", "Char in 80-char a line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=false:rgba=0:pixelsize=10", NULL}}, + {"-a24text", "Char in 30-char a line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=false:rgba=0:pixelsize=24", NULL}}, + {"-aftext", "Char in 80-char a line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=false:rgba=0:pixelsize=12", NULL}}, + {"-rgb10text", "Char in 80-char rgb line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=true:rgba=rgb:pixelsize=10", NULL}}, + {"-rgb24text", "Char in 30-char rgb line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=true:rgba=rgb:pixelsize=24", NULL}}, + {"-rgbftext", "Char in 80-char rgb line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=true:rgba=rgb:pixelsize=12", NULL}}, + {"-caa10text", "Char in 80-char aa core line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=true:render=false:rgba=0:pixelsize=10", NULL}}, + {"-caa24text", "Char in 30-char aa core line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=true:render=false:rgba=0:pixelsize=24", NULL}}, + {"-caaftext", "Char in 80-char aa core line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=true:render=false:rgba=0:pixelsize=12", NULL}}, + {"-ca10text", "Char in 80-char a core line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=false:render=false:rgba=0:pixelsize=10", NULL}}, + {"-ca24text", "Char in 30-char a core line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=false:render=false:rgba=0:pixelsize=24", NULL}}, + {"-caftext", "Char in 80-char a core line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=false:render=false:rgba=0:pixelsize=12", NULL}}, + {"-rgb10text", "Char in 80-char rgb core line (Charter 10)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 10, "charter:antialias=true:render=false:rgba=rgb:pixelsize=10", NULL}}, + {"-rgb24text", "Char in 30-char rgb core line (Charter 24)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {30, 24, "charter:antialias=true:render=false:rgba=rgb:pixelsize=24", NULL}}, + {"-rgbftext", "Char in 80-char rgb core line (Courier 12)", NULL, + InitAAText, DoAAText, ClearTextWin, EndAAText, + V1_5FEATURE, NONROP, 0, + {80, 12, "courier:antialias=true:render=false:rgba=rgb:pixelsize=12", NULL}}, +#endif {"-scroll10", "Scroll 10x10 pixels", NULL, InitScroll, DoScroll, MidScroll, EndScroll, V1_2FEATURE, ROP, 0, @@ -1247,11 +1200,11 @@ Test test[] = { V1_2FEATURE, WINDOW, 0, {0, False}}, {"-map", "Map window via parent", NULL, - InitMap, MapParents, UnmapParents, EndCreate, + InitMap, MapParents, UnmapParentsCleanup, EndCreate, V1_2FEATURE, WINDOW, 0, {0, True}}, {"-unmap", "Unmap window via parent", NULL, - InitDestroy, UnmapParents, MapParents, EndCreate, + InitDestroy, UnmapParents, MapParentsCleanup, EndCreate, V1_2FEATURE, WINDOW, 0, {0, True}}, {"-destroy", "Destroy window via parent", NULL, diff --git a/do_text.c b/do_text.c index c8f337f..23303ee 100644 --- a/do_text.c +++ b/do_text.c @@ -21,8 +21,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_text.c,v 1.9 2002/12/04 10:28:08 eich Exp $ */ #include "x11perf.h" +#include static char **charBuf; static XFontStruct *font, *bfont; @@ -34,10 +36,8 @@ static int charsPerLine, totalLines; #define SEGS 3 -int InitText(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitText(XParms xp, Parms p, int reps) { int i, j; char ch; @@ -120,16 +120,14 @@ int InitText(xp, p, reps) | pci->ascent | pci->descent | pci->attributes) == 0); \ } /* GetRealChar */ -int InitText16(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitText16(XParms xp, Parms p, int reps) { register int i, j; register char *pbuf0, *pbuf1, *pbuf2; XGCValues gcv; int rows, columns, totalChars, ch; - int brows, bcolumns, btotalChars, bch; + int brows, bcolumns = 0, btotalChars = 0, bch = 0; font = XLoadQueryFont(xp->d, p->font); if (font == NULL) { @@ -221,10 +219,8 @@ int InitText16(xp, p, reps) return reps; } -void DoText(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoText(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -241,13 +237,12 @@ void DoText(xp, p, reps) startLine = (startLine + 1) % totalLines; } line = (line + 1) % totalLines; + CheckAbort (); } } -void DoText16(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoText16(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -264,13 +259,12 @@ void DoText16(xp, p, reps) startLine = (startLine + 1) % totalLines; } line = (line + 1) % totalLines; + CheckAbort (); } } -void DoPolyText(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoPolyText(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -287,13 +281,12 @@ void DoPolyText(xp, p, reps) startLine = (startLine + 1) % totalLines; } line = (line + 1) % totalLines; + CheckAbort (); } } -void DoPolyText16(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoPolyText16(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -310,13 +303,12 @@ void DoPolyText16(xp, p, reps) startLine = (startLine + 1) % totalLines; } line = (line + 1) % totalLines; + CheckAbort (); } } -void DoImageText(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoImageText(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -333,13 +325,12 @@ void DoImageText(xp, p, reps) line = startLine; } line = (line + 1) % totalLines; + CheckAbort (); } } -void DoImageText16(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoImageText16(XParms xp, Parms p, int reps) { int i, line, startLine; @@ -356,19 +347,18 @@ void DoImageText16(xp, p, reps) line = startLine; } line = (line + 1) % totalLines; + CheckAbort (); } } -void ClearTextWin(xp, p) - XParms xp; - Parms p; +void +ClearTextWin(XParms xp, Parms p) { XClearWindow(xp->d, xp->w); } -void EndText(xp, p) - XParms xp; - Parms p; +void +EndText(XParms xp, Parms p) { int i; @@ -383,9 +373,8 @@ void EndText(xp, p) XFreeFont(xp->d, bfont); } -void EndText16(xp, p) - XParms xp; - Parms p; +void +EndText16(XParms xp, Parms p) { int i; @@ -409,3 +398,117 @@ void EndText16(xp, p) } } +#ifdef XFT +#include +#include + +static XftFont *aafont; +static XftDraw *aadraw; +static XftColor aacolor; + +int +InitAAText(XParms xp, Parms p, int reps) +{ + int i, j; + char ch; + XRenderColor color; + + aafont = XftFontOpenName (xp->d, DefaultScreen (xp->d), p->font); + + if (aafont == NULL) + { + printf("Could not load font '%s', benchmark omitted\n", + p->font); + return 0; + } + + aadraw = XftDrawCreate (xp->d, xp->w, + xp->vinfo.visual, + xp->cmap); + + if (!aadraw) + { + printf ("Cannot create XftDraw object\n"); + XftFontClose (xp->d, aafont); + return 0; + } + color.red = 0; + color.green = 0; + color.blue = 0; + color.alpha = 0xffff; + if (!XftColorAllocValue (xp->d, + xp->vinfo.visual, + xp->cmap, + &color, &aacolor)) + { + printf ("Cannot allocate black\n"); + XftFontClose (xp->d, aafont); + XftDrawDestroy (aadraw); + aafont = 0; + aadraw = 0; + return 0; + } + + ypos = XPOS; + height = aafont->height; + + charsPerLine = p->objects; + charsPerLine = (charsPerLine + 3) & ~3; + p->objects = charsPerLine; + + totalLines = '\177' - ' ' + 1; + if (totalLines > reps) totalLines = reps; + + charBuf = (char **) malloc(totalLines*sizeof (char *)); + + for (i = 0; i != totalLines; i++) { + charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine); + ch = i + ' '; + for (j = 0; j != charsPerLine; j++) { + charBuf[i][j] = ch; + if (ch == '\177') ch = ' '; else ch++; + } + } + return reps; +} + +void +DoAAText(XParms xp, Parms p, int reps) +{ + int i, line, startLine; + + startLine = 0; + line = 0; + for (i = 0; i != reps; i++) { + XftDrawString8 (aadraw, &aacolor, aafont, + XPOS, ypos, (unsigned char *) charBuf[line], charsPerLine); + ypos += height; + if (ypos > HEIGHT - height) { + /* Wraparound to top of window */ + ypos = XPOS; + line = startLine; + startLine = (startLine + 1) % totalLines; + } + line = (line + 1) % totalLines; + CheckAbort (); + } +} + +void +EndAAText(XParms xp, Parms p) +{ + int i; + + if(!aadraw)return; + for (i = 0; i != totalLines; i++) + free(charBuf[i]); + free(charBuf); + XftDrawDestroy (aadraw); + XftFontClose (xp->d, aafont); + XftColorFree (xp->d, + xp->vinfo.visual, + xp->cmap, + &aacolor); +} + +#endif diff --git a/do_traps.c b/do_traps.c index 5605ff3..4c0b4ce 100644 --- a/do_traps.c +++ b/do_traps.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_traps.c,v 1.9 2002/12/04 10:28:08 eich Exp $ */ #include "x11perf.h" #include "bitmaps.h" @@ -29,10 +30,8 @@ SOFTWARE. static XPoint *points; static GC pgc; -int InitTrapezoids(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitTrapezoids(XParms xp, Parms p, int reps) { int i, numPoints; int rows; @@ -80,10 +79,8 @@ int InitTrapezoids(xp, p, reps) return reps; } -void DoTrapezoids(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoTrapezoids(XParms xp, Parms p, int reps) { int i, j; XPoint *curPoint; @@ -99,13 +96,154 @@ void DoTrapezoids(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } -void EndTrapezoids(xp, p) - XParms xp; - Parms p; +void +EndTrapezoids(XParms xp, Parms p) { free(points); } +#ifdef XRENDER +#include +#include + +static XTrapezoid *traps; +static XftDraw *aadraw; +static XftColor aablack, aawhite; +static XRenderPictFormat *maskFormat; + +int +InitFixedTrapezoids(XParms xp, Parms p, int reps) +{ + int i, numTraps; + int rows; + int x, y; + int size, skew; + XTrapezoid *curTrap; + XRenderColor color; + + pgc = xp->fggc; + + size = p->special; + numTraps = p->objects; + traps = (XTrapezoid *)malloc(numTraps * sizeof(XTrapezoid)); + curTrap = traps; + x = size; + y = 0; + rows = 0; + skew = size; + aadraw = XftDrawCreate (xp->d, xp->w, + xp->vinfo.visual, + xp->cmap); + if (p->font && !strcmp (p->font, "add")) + { + XRenderPictFormat templ; + templ.type = PictTypeDirect; + templ.depth = 8; + templ.direct.alpha = 0; + templ.direct.alphaMask = 0xff; + maskFormat = XRenderFindFormat (xp->d, + PictFormatType | + PictFormatDepth | + PictFormatAlpha | + PictFormatAlphaMask, + &templ, + 0); + } + else + maskFormat = 0; + color.red = 0; + color.green = 0; + color.blue = 0; + color.alpha = 0xffff; + if (!XftColorAllocValue (xp->d, + xp->vinfo.visual, + xp->cmap, + &color, &aablack)) + { + XftDrawDestroy (aadraw); + aadraw = 0; + return 0; + } + color.red = 0xffff; + color.green = 0xffff; + color.blue = 0xffff; + color.alpha = 0xffff; + if (!XftColorAllocValue (xp->d, + xp->vinfo.visual, + xp->cmap, + &color, &aawhite)) + { + XftDrawDestroy (aadraw); + aadraw = 0; + return 0; + } + + for (i = 0; i != p->objects; i++, curTrap ++) { + curTrap->top = XDoubleToFixed (y); + curTrap->bottom = XDoubleToFixed (y + size); + curTrap->left.p1.x = XDoubleToFixed (x - skew); + curTrap->left.p1.y = XDoubleToFixed (y); + curTrap->left.p2.x = XDoubleToFixed (x + skew - size); + curTrap->left.p2.y = XDoubleToFixed (y + size); + + curTrap->right.p1.x = XDoubleToFixed (x - skew + size); + curTrap->right.p1.y = XDoubleToFixed (y); + curTrap->right.p2.x = XDoubleToFixed (x + skew); + curTrap->right.p2.y = XDoubleToFixed (y + size); + + skew--; + if (skew < 0) skew = size; + + y += size; + rows++; + if (y + size > HEIGHT || rows == MAXROWS) { + rows = 0; + y = 0; + x += 2 * size; + if (x + size > WIDTH) { + x = size; + } + } + } + + + SetFillStyle(xp, p); + return reps; +} + +void +DoFixedTrapezoids(XParms xp, Parms p, int reps) +{ + int i; + XTrapezoid *curTrap; + Picture white, black, src, dst; + + white = XftDrawSrcPicture (aadraw, &aawhite); + black = XftDrawSrcPicture (aadraw, &aablack); + dst = XftDrawPicture (aadraw); + + src = black; + for (i = 0; i != reps; i++) { + curTrap = traps; + XRenderCompositeTrapezoids (xp->d, PictOpOver, src, dst, maskFormat, + 0, 0, traps, p->objects); + if (src == black) + src = white; + else + src = black; + CheckAbort (); + } +} + +void +EndFixedTrapezoids (XParms xp, Parms p) +{ + free (traps); + XftDrawDestroy (aadraw); +} + +#endif /* XRENDER */ diff --git a/do_tris.c b/do_tris.c index 836c6ef..d8b0c3b 100644 --- a/do_tris.c +++ b/do_tris.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_tris.c,v 1.5 2001/01/17 23:45:12 dawes Exp $ */ #undef POLYTRIANGLE_HACK /* don't use this code */ @@ -41,23 +42,23 @@ static GC pgc; #define PI 3.14159265357989 #endif -double Area(p1, p2, p3) - XPoint p1, p2, p3; +static double +Area(XPoint p1, XPoint p2, XPoint p3) { return (p1.x*p2.y - p1.x*p3.y + p2.x*p3.y - p2.x*p1.y + p3.x*p1.y - p3.x*p2.y)/2; } -double Distance(p1, p2) - XPoint p1, p2; +/* +static double +Distance(XPoint p1, XPoint p2) { return sqrt((float) ((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y))); } +*/ -int InitTriangles(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitTriangles(XParms xp, Parms p, int reps) { int i, j, numPoints; int rows; @@ -132,10 +133,8 @@ int InitTriangles(xp, p, reps) #ifndef POLYTRIANGLE_HACK -void DoTriangles(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoTriangles(XParms xp, Parms p, int reps) { int i, j; XPoint *curPoint; @@ -151,40 +150,20 @@ void DoTriangles(xp, p, reps) pgc = xp->fggc; else pgc = xp->bggc; + CheckAbort (); } } #else -void DoTriangles(xp, p, reps) - XParms xp; - Parms p; - int reps; -{ - int i, j; - XPoint *curPoint; - - for (i = 0; i != reps; i++) { - XPolyTriangle (xp->d, xp->w, pgc, points, p->objects, Convex, - CoordModeOrigin); - if (pgc == xp->bggc) - pgc = xp->fggc; - else - pgc = xp->bggc; - } -} static xReq _dummy_request = { 0, 0, 0 }; -XPolyTriangle(dpy, d, gc, points, n_triangles, shape, mode) -register Display *dpy; -Drawable d; -GC gc; -XPoint *points; -int n_triangles; -int shape; -int mode; +static void +XPolyTriangle(register Display *dpy, + Drawable d, GC gc, XPoint *points, + int n_triangles, int shape, int mode) { register xFillPolyReq *req; register long nbytes; @@ -228,11 +207,27 @@ int mode; UnlockDisplay(dpy); SyncHandle(); } + +void +DoTriangles(XParms xp, Parms p, int reps) +{ + int i, j; + XPoint *curPoint; + + for (i = 0; i != reps; i++) { + XPolyTriangle (xp->d, xp->w, pgc, points, p->objects, Convex, + CoordModeOrigin); + if (pgc == xp->bggc) + pgc = xp->fggc; + else + pgc = xp->bggc; + CheckAbort (); + } +} #endif -void EndTriangles(xp, p) - XParms xp; - Parms p; +void +EndTriangles(XParms xp, Parms p) { free(points); } diff --git a/do_valgc.c b/do_valgc.c index c458c2f..5d2b45d 100644 --- a/do_valgc.c +++ b/do_valgc.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_valgc.c,v 1.5 2001/01/17 23:45:12 dawes Exp $ */ #ifndef VMS #include @@ -31,10 +32,8 @@ SOFTWARE. static Window win[2]; -int InitGC(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitGC(XParms xp, Parms p, int reps) { win[0] = XCreateSimpleWindow( xp->d, xp->w, 10, 10, 10, 10, 1, xp->foreground, xp->background); @@ -44,10 +43,8 @@ int InitGC(xp, p, reps) return reps; } -void DoChangeGC(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoChangeGC(XParms xp, Parms p, int reps) { int i; XGCValues gcv; @@ -68,12 +65,12 @@ void DoChangeGC(xp, p, reps) gcv.foreground = xp->foreground; XChangeGC(xp->d, xp->fggc, GCForeground , &gcv); XDrawPoint(xp->d, win[1], xp->fggc, 5, 5); + CheckAbort (); } } -void EndGC(xp, p) - XParms xp; - Parms p; +void +EndGC(XParms xp, Parms p) { XDestroyWindow(xp->d, win[0]); XDestroyWindow(xp->d, win[1]); diff --git a/do_windows.c b/do_windows.c index c6b386d..954d1e6 100644 --- a/do_windows.c +++ b/do_windows.c @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/do_windows.c,v 1.5 2001/01/17 23:45:12 dawes Exp $ */ #include "x11perf.h" @@ -31,9 +32,8 @@ static int parentrows, parentcolumns, parentwindows; static int parentwidth, parentheight; static Window popup; -void ComputeSizes(xp, p) - XParms xp; - Parms p; +static void +ComputeSizes(XParms xp, Parms p) { childwindows = p->objects; childrows = (childwindows + MAXCOLS - 1) / MAXCOLS; @@ -43,10 +43,8 @@ void ComputeSizes(xp, p) parentheight = (CHILDSIZE+CHILDSPACE) * childrows; } -int CreateParents(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +CreateParents(XParms xp, Parms p, int reps) { int i; @@ -87,10 +85,18 @@ int CreateParents(xp, p, reps) } /* CreateParents */ -void MapParents(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +MapParents(XParms xp, Parms p, int reps) +{ + int i; + + for (i = 0; i != parentwindows; i++) { + XMapWindow(xp->d, parents[i]); + } +} + +void +MapParentsCleanup(XParms xp, Parms p) { int i; @@ -100,20 +106,16 @@ void MapParents(xp, p, reps) } -int InitCreate(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitCreate(XParms xp, Parms p, int reps) { reps = CreateParents(xp, p, reps); MapParents(xp, p, reps); return reps; } -void CreateChildGroup(xp, p, parent) - XParms xp; - Parms p; - Window parent; +static void +CreateChildGroup(XParms xp, Parms p, Window parent) { int j; @@ -128,10 +130,8 @@ void CreateChildGroup(xp, p, parent) XMapSubwindows (xp->d, parent); } -void CreateChildren(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +CreateChildren(XParms xp, Parms p, int reps) { int i; @@ -140,10 +140,8 @@ void CreateChildren(xp, p, reps) } /* end i */ } -void DestroyChildren(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DestroyChildren(XParms xp, Parms p) { int i; @@ -152,9 +150,8 @@ void DestroyChildren(xp, p, reps) } } -void EndCreate(xp, p) - XParms xp; - Parms p; +void +EndCreate(XParms xp, Parms p) { XDestroySubwindows(xp->d, xp->w); free(parents); @@ -162,20 +159,26 @@ void EndCreate(xp, p) } -int InitMap(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitMap(XParms xp, Parms p, int reps) { reps = CreateParents(xp, p, reps); CreateChildren(xp, p, reps); return reps; } -void UnmapParents(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +UnmapParents(XParms xp, Parms p, int reps) +{ + int i; + + for (i = 0; i != parentwindows; i++) { + XUnmapWindow(xp->d, parents[i]); + } +} + +void +UnmapParentsCleanup(XParms xp, Parms p) { int i; @@ -184,10 +187,8 @@ void UnmapParents(xp, p, reps) } } -int InitDestroy(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitDestroy(XParms xp, Parms p, int reps) { reps = CreateParents(xp, p, reps); CreateChildren(xp, p, reps); @@ -195,10 +196,8 @@ int InitDestroy(xp, p, reps) return reps; } -void DestroyParents(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DestroyParents(XParms xp, Parms p, int reps) { int i; @@ -208,9 +207,8 @@ void DestroyParents(xp, p, reps) } -void RenewParents(xp, p) - XParms xp; - Parms p; +void +RenewParents(XParms xp, Parms p) { int i; @@ -222,10 +220,8 @@ void RenewParents(xp, p) MapParents(xp, p, parentwindows); } -int InitPopups(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +InitPopups(XParms xp, Parms p, int reps) { #ifdef CHILDROOT XWindowAttributes xwa; @@ -265,21 +261,19 @@ int InitPopups(xp, p, reps) return reps; } -void DoPopUps(xp, p, reps) - XParms xp; - Parms p; - int reps; +void +DoPopUps(XParms xp, Parms p, int reps) { int i; for (i = 0; i != reps; i++) { XMapWindow(xp->d, popup); XUnmapWindow(xp->d, popup); + CheckAbort (); } } -void EndPopups(xp, p) - XParms xp; - Parms p; +void +EndPopups(XParms xp, Parms p) { XDestroySubwindows(xp->d, xp->w); #ifdef CHILDROOT diff --git a/x11pcomp.cpp b/x11pcomp.cpp index cbfc24e..2fa5b38 100644 --- a/x11pcomp.cpp +++ b/x11pcomp.cpp @@ -1,4 +1,7 @@ XCOMM! /bin/sh +XCOMM +XCOMM $XFree86: xc/programs/x11perf/x11pcomp.cpp,v 1.5 2002/11/25 14:05:05 eich Exp $ +XCOMM XCOMM Collects multiple outputs of x11perf. Just feed it a list of files, each XCOMM containing the output from an x11perf run, and this shell will extract the XCOMM object/second information and show it in tabular form. An 80-column line @@ -22,9 +25,10 @@ PATH=LIBPATH:.:$PATH export PATH set -e -tmp=/tmp/rates.$$ +tmp=${TMPDIR-/tmp}/rates.$$ trap "rm -rf $tmp" 0 1 2 15 -mkdir $tmp $tmp/rates +mkdir $tmp || exit 1 +mkdir $tmp/rates ratio= allfiles= XCOMM Include relative rates in output? Report only relative rates? diff --git a/x11perf.c b/x11perf.c index 7bff401..2cf11d4 100644 --- a/x11perf.c +++ b/x11perf.c @@ -1,4 +1,4 @@ -/* $Xorg: x11perf.c,v 1.6 2001/01/23 17:21:42 pookie Exp $ */ +/* $Xorg: x11perf.c,v 1.4 2000/08/17 19:54:10 cpqbld Exp $ */ /**************************************************************************** Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -21,6 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************************/ +/* $XFree86: xc/programs/x11perf/x11perf.c,v 3.8 2002/12/04 10:28:08 eich Exp $ */ #include #include @@ -35,37 +36,35 @@ SOFTWARE. #include "x11perf.h" #include -#ifdef X_NOT_STDC_ENV -#define Time_t long -extern Time_t time (); -#else #include #define Time_t time_t -#endif +#include /* Only for working on ``fake'' servers, for hardware that doesn't exist */ static Bool drawToFakeServer = False; static Pixmap tileToQuery = None; +static char *displayName; +int abortTest; typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr; RopNameRec ropNames[] = { - "clear", GXclear, /* 0 */ - "and", GXand, /* src AND dst */ - "andReverse", GXandReverse, /* src AND NOT dst */ - "copy", GXcopy, /* src */ - "andInverted", GXandInverted, /* NOT src AND dst */ - "noop", GXnoop, /* dst */ - "xor", GXxor, /* src XOR dst */ - "or", GXor, /* src OR dst */ - "nor", GXnor, /* NOT src AND NOT dst */ - "equiv", GXequiv, /* NOT src XOR dst */ - "invert", GXinvert, /* NOT dst */ - "orReverse", GXorReverse, /* src OR NOT dst */ - "copyInverted", GXcopyInverted, /* NOT src */ - "orInverted", GXorInverted, /* NOT src OR dst */ - "nand", GXnand, /* NOT src OR NOT dst */ - "set", GXset, /* 1 */ + { "clear", GXclear }, /* 0 */ + { "and", GXand }, /* src AND dst */ + { "andReverse", GXandReverse }, /* src AND NOT dst */ + { "copy", GXcopy }, /* src */ + { "andInverted", GXandInverted }, /* NOT src AND dst */ + { "noop", GXnoop }, /* dst */ + { "xor", GXxor }, /* src XOR dst */ + { "or", GXor }, /* src OR dst */ + { "nor", GXnor }, /* NOT src AND NOT dst */ + { "equiv", GXequiv }, /* NOT src XOR dst */ + { "invert", GXinvert }, /* NOT dst */ + { "orReverse", GXorReverse }, /* src OR NOT dst */ + { "copyInverted", GXcopyInverted }, /* NOT src */ + { "orInverted", GXorInverted }, /* NOT src OR dst */ + { "nand", GXnand }, /* NOT src OR NOT dst */ + { "set", GXset } /* 1 */ }; char *(visualClassNames)[] = { @@ -121,12 +120,16 @@ static Window clipWindows[MAXCLIP]; static Colormap cmap; static int depth = -1; /* -1 means use default depth */ static int vclass = -1; /* -1 means use CopyFromParent */ -static Visual *visual = CopyFromParent; /* ScreenSaver state */ static XParmRec xparms; static int ssTimeout, ssInterval, ssPreferBlanking, ssAllowExposures; +/* Static functions */ +static int GetWords(int argi, int argc, char **argv, char **wordsp, int *nump); +static int GetNumbers(int argi, int argc, char **argv, unsigned long *intsp, + int *nump); +static int GetRops(int argi, int argc, char **argv, int *ropsp, int *nump); /************************************************ * time related stuff * @@ -179,7 +182,8 @@ int gettimeofday(tp) static struct timeval start; -void PrintTime() +static void +PrintTime(void) { Time_t t; @@ -187,13 +191,14 @@ void PrintTime() printf("%s\n", ctime(&t)); } -void InitTimes () +static void +InitTimes(void) { X_GETTIMEOFDAY(&start); } -double ElapsedTime(correction) - double correction; +static double +ElapsedTime(double correction) { struct timeval stop; @@ -206,8 +211,8 @@ double ElapsedTime(correction) (1000000.0 * (double)(stop.tv_sec - start.tv_sec)) - correction; } -double RoundTo3Digits(d) - double d; +static double +RoundTo3Digits(double d) { /* It's kind of silly to print out things like ``193658.4/sec'' so just junk all but 3 most significant digits. */ @@ -240,10 +245,8 @@ double RoundTo3Digits(d) } -void ReportTimes(usecs, n, str, average) - double usecs; - int n; - char *str; +static void +ReportTimes(double usecs, int n, char *str, int average) { double msecsperobj, objspersec; @@ -277,15 +280,15 @@ void ReportTimes(usecs, n, str, average) ************************************************/ static char *program_name; -void usage(); +static void usage(void); /* * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +static char * +Get_Display_Name(int *pargc, /* MODIFIED */ + char **argv) /* MODIFIED */ { int argc = *pargc; char **pargv = argv+1; @@ -319,9 +322,9 @@ char *Get_Display_Name(pargc, argv) * If found remove it from command line. Don't go past a lone -. */ -Version GetVersion(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +static Version +GetVersion(int *pargc, /* MODIFIED */ + char **argv) /* MODIFIED */ { int argc = *pargc; char **pargv = argv+1; @@ -375,8 +378,8 @@ Version GetVersion(pargc, argv) /* * Open_Display: Routine to open a display with correct error handling. */ -Display *Open_Display(display_name) - char *display_name; +static Display * +Open_Display(char *display_name) { Display *d; @@ -385,7 +388,6 @@ Display *Open_Display(display_name) fprintf (stderr, "%s: unable to open display '%s'\n", program_name, XDisplayName (display_name)); exit(1); - /* doesn't return */ } return(d); @@ -393,28 +395,33 @@ Display *Open_Display(display_name) #ifdef SIGNALRETURNSINT -int +static int #else -void +static void #endif -Cleanup(sig) - int sig; +Cleanup(int sig) +{ + abortTest = sig; +} + +void +AbortTest(void) { fflush(stdout); - /* This will screw up if Xlib is in the middle of something */ + XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking, ssAllowExposures); XFlush(xparms.d); - exit(sig); + exit (abortTest); } - /************************************************ * Performance stuff * ************************************************/ -void usage() +static void +usage(void) { char **cpp; int i = 0; @@ -470,23 +477,19 @@ NULL}; exit (1); } -void NullProc(xp, p) - XParms xp; - Parms p; +void +NullProc(XParms xp, Parms p) { } -Bool NullInitProc(xp, p, reps) - XParms xp; - Parms p; - int reps; +int +NullInitProc(XParms xp, Parms p, int reps) { return reps; } - -void HardwareSync(xp) - XParms xp; +static void +HardwareSync(XParms xp) { /* * Some graphics hardware allows the server to claim it is done, @@ -501,15 +504,14 @@ void HardwareSync(xp) if (image) XDestroyImage(image); } -void DoHardwareSync(xp, p, reps) - XParms xp; - Parms p; - int reps; +static void +DoHardwareSync(XParms xp, Parms p, int reps) { int i; for (i = 0; i != reps; i++) { HardwareSync(xp); + CheckAbort (); } } @@ -521,9 +523,8 @@ static Test syncTest = { }; -static Window CreatePerfWindow(xp, x, y, width, height) - XParms xp; - int width, height, x, y; +static Window +CreatePerfWindow(XParms xp, int x, int y, int width, int height) { XSetWindowAttributes xswa; Window w; @@ -554,9 +555,8 @@ static Window CreatePerfWindow(xp, x, y, width, height) } -void CreateClipWindows(xp, clips) - XParms xp; - int clips; +static void +CreateClipWindows(XParms xp, int clips) { int j; XWindowAttributes xwa; @@ -570,9 +570,8 @@ void CreateClipWindows(xp, clips) } /* CreateClipWindows */ -void DestroyClipWindows(xp, clips) - XParms xp; - int clips; +static void +DestroyClipWindows(XParms xp, int clips) { int j; @@ -583,10 +582,8 @@ void DestroyClipWindows(xp, clips) } /* DestroyClipWindows */ -double DoTest(xp, test, reps) - XParms xp; - Test *test; - int reps; +static double +DoTest(XParms xp, Test *test, int reps) { double time; unsigned int ret_width, ret_height; @@ -600,6 +597,7 @@ double DoTest(xp, test, reps) HardwareSync(xp); time = ElapsedTime(syncTime); + CheckAbort (); if (drawToFakeServer) XQueryBestSize(xp->d, TileShape, tileToQuery, 32, 32, &ret_width, &ret_height); @@ -608,11 +606,8 @@ double DoTest(xp, test, reps) } -int CalibrateTest(xp, test, seconds, usecperobj) - XParms xp; - Test *test; - int seconds; - double *usecperobj; +static int +CalibrateTest(XParms xp, Test *test, int seconds, double *usecperobj) { #define goal 2500000.0 /* Try to get up to 2.5 seconds */ #define enough 2000000.0 /* But settle for 2.0 seconds */ @@ -637,6 +632,7 @@ int CalibrateTest(xp, test, seconds, usecperobj) XDestroySubwindows(xp->d, xp->w); XClearWindow(xp->d, xp->w); didreps = (*test->init) (xp, &test->parms, reps); + CheckAbort (); if (didreps == 0) { return 0; } @@ -652,6 +648,7 @@ int CalibrateTest(xp, test, seconds, usecperobj) (*test->passCleanup) (xp, &test->parms); (*test->cleanup) (xp, &test->parms); DestroyClipWindows(xp, test->clips); + CheckAbort (); if (didreps != reps) { /* The test can't do the number of reps as we asked for. @@ -686,10 +683,8 @@ int CalibrateTest(xp, test, seconds, usecperobj) return reps; } /* CalibrateTest */ -void CreatePerfGCs(xp, func, pm) - XParms xp; - int func; - unsigned long pm; +static void +CreatePerfGCs(XParms xp, int func, unsigned long pm) { XGCValues gcvfg, gcvbg, gcvddbg,gcvddfg; unsigned long fg, bg, ddbg; @@ -742,8 +737,8 @@ void CreatePerfGCs(xp, func, pm) } -void DestroyPerfGCs(xp) - XParms(xp); +static void +DestroyPerfGCs(XParms xp) { XFreeGC(xp->d, xp->fggc); XFreeGC(xp->d, xp->bggc); @@ -751,10 +746,8 @@ void DestroyPerfGCs(xp) XFreeGC(xp->d, xp->ddbggc); } -unsigned long AllocateColor(display, name, pixel) - Display *display; - char *name; - unsigned long pixel; +static unsigned long +AllocateColor(Display *display, char *name, unsigned long pixel) { XColor color; @@ -778,10 +771,8 @@ unsigned long AllocateColor(display, name, pixel) } /* AllocateColor */ -void DisplayStatus(d, message, test, try) - Display *d; - char *message; - char *test; +static void +DisplayStatus(Display *d, char *message, char *test, int try) { char s[500]; @@ -793,12 +784,8 @@ void DisplayStatus(d, message, test, try) } -void ProcessTest(xp, test, func, pm, label) - XParms xp; - Test *test; - int func; - unsigned long pm; - char *label; +static void +ProcessTest(XParms xp, Test *test, int func, unsigned long pm, char *label) { double time, totalTime; int reps; @@ -813,6 +800,8 @@ void ProcessTest(xp, test, func, pm, label) XDestroySubwindows(xp->d, xp->w); XClearWindow(xp->d, xp->w); reps = (*test->init) (xp, &test->parms, reps); + if (abortTest) + AbortTest (); /* * if using fixedReps then will not have done CalibrateTest so must * check result of init for 0 here @@ -828,6 +817,8 @@ void ProcessTest(xp, test, func, pm, label) for (j = 0; j != repeat; j++) { DisplayStatus(xp->d, "Testing", label, j+1); time = DoTest(xp, test, reps); + if (abortTest) + AbortTest (); totalTime += time; ReportTimes (time, reps * test->parms.objects, label, False); @@ -847,41 +838,23 @@ void ProcessTest(xp, test, func, pm, label) DestroyPerfGCs(xp); } /* ProcessTest */ -#ifndef X_NOT_STDC_ENV #define Strstr strstr -#else -char *Strstr(s1, s2) - char *s1, *s2; -{ - int n1, n2; - - n1 = strlen(s1); - n2 = strlen(s2); - for ( ; n1 >= n2; s1++, n1--) { - if (!strncmp(s1, s2, n2)) - return s1; - } - return NULL; -} -#endif #define LABELP(i) (test[i].label14 && (xparms.version >= VERSION1_4) \ ? test[i].label14 : test[i].label) -main(argc, argv) - int argc; - char **argv; - +int +main(int argc, char *argv[]) { int i, j, n, skip; int numTests; /* Even though the linker knows, we don't. */ char hostname[100]; - char *displayName; Bool foundOne = False; Bool synchronous = False; XGCValues tgcv; int screen; int rop, pm; + int window_y, window_x; XVisualInfo *vinfolist, vinfotempl; unsigned long vmask; @@ -1100,7 +1073,7 @@ main(argc, argv) LABELP(i)); } } else { - printf ("(%s 0x%x) %s\n", + printf ("(%s 0x%lx) %s\n", ropNames[rops[rop]].name, planemasks[pm], LABELP(i)); @@ -1115,7 +1088,7 @@ main(argc, argv) if (planemasks[pm] == ~0) { printf ("%s\n", LABELP(i)); } else { - printf ("(0x%x) %s\n", + printf ("(0x%lx) %s\n", planemasks[pm], LABELP(i)); } @@ -1124,7 +1097,7 @@ main(argc, argv) case WINDOW: for (child = 0; child != numSubWindows; child++) { - printf ("%s (%d kids)\n", + printf ("%s (%ld kids)\n", LABELP(i), subWindows[child]); } break; @@ -1192,7 +1165,8 @@ main(argc, argv) XInstallColormap(xparms.d, cmap); } } - + xparms.cmap = cmap; + printf("x11perf - X11 performance program, version %s\n", xparms.version & VERSION1_5 ? "1.5" : xparms.version & VERSION1_4 ? "1.4" : @@ -1238,14 +1212,20 @@ main(argc, argv) AllocateColor(xparms.d, background, WhitePixel(xparms.d, screen)); xparms.ddbackground = AllocateColor(xparms.d, ddbackground, WhitePixel(xparms.d, screen)); - xparms.w = CreatePerfWindow(&xparms, 2, 2, WIDTH, HEIGHT); + window_x = 2; + if (DisplayWidth(xparms.d, screen) < WIDTH + window_x + 1) + window_x = -1; + window_y = 2; + if (DisplayHeight(xparms.d, screen) < HEIGHT + window_y + 1) + window_y = -1; + xparms.w = CreatePerfWindow(&xparms, window_x, window_y, WIDTH, HEIGHT); HSx = WIDTH-1; - if (3 + WIDTH > DisplayWidth(xparms.d, screen)) - HSx = DisplayWidth(xparms.d, screen) - 4; + if (window_x + 1 + WIDTH > DisplayWidth(xparms.d, screen)) + HSx = DisplayWidth(xparms.d, screen) - (1 + window_x + 1); HSy = HEIGHT-1; - if (3 + HEIGHT > DisplayHeight(xparms.d, screen)) - HSy = DisplayHeight(xparms.d, screen) - 4; - status = CreatePerfWindow(&xparms, 2, HEIGHT+5, WIDTH, 20); + if (window_y + 1 + HEIGHT > DisplayHeight(xparms.d, screen)) + HSy = DisplayHeight(xparms.d, screen) - (1 + window_y + 1); + status = CreatePerfWindow(&xparms, window_x, HEIGHT+5, WIDTH, 20); tgcv.foreground = AllocateColor(xparms.d, "black", BlackPixel(xparms.d, screen)); tgcv.background = @@ -1261,7 +1241,7 @@ main(argc, argv) software cursor machines it will slow graphics performance. On all current MIT-derived servers it will slow window creation/configuration performance. */ - XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, WIDTH+10, 20+10); + XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, WIDTH+32, 20+32); /* Figure out how long to call HardwareSync, so we can adjust for that in our total elapsed time */ @@ -1293,7 +1273,7 @@ main(argc, argv) LABELP(i)); } } else { - sprintf (label, "(%s 0x%x) %s", + sprintf (label, "(%s 0x%lx) %s", ropNames[rops[rop]].name, planemasks[pm], LABELP(i)); @@ -1310,7 +1290,7 @@ main(argc, argv) if (planemasks[pm] == ~0) { sprintf (label, "%s", LABELP(i)); } else { - sprintf (label, "(0x%x) %s", + sprintf (label, "(0x%lx) %s", planemasks[pm], LABELP(i)); } @@ -1336,22 +1316,18 @@ main(argc, argv) XDestroyWindow(xparms.d, xparms.w); XFree(vinfolist); if (drawToFakeServer) - XFreePixmap(xparms.d, tileToQuery); + XFreePixmap(xparms.d, tileToQuery); /* Restore ScreenSaver to original state. */ XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking, ssAllowExposures); XCloseDisplay(xparms.d); free(saveargv); free(doit); + exit(0); } -int -GetWords (argi, argc, argv, wordsp, nump) - int argi; - int argc; - char **argv; - char **wordsp; - int *nump; +static int +GetWords (int argi, int argc, char **argv, char **wordsp, int *nump) { int count; @@ -1368,10 +1344,9 @@ GetWords (argi, argc, argv, wordsp, nump) } static long -atox (s) - char *s; +atox (char *s) { - long v, c; + long v, c = 0; v = 0; while (*s) { @@ -1387,12 +1362,8 @@ atox (s) return v; } -int GetNumbers (argi, argc, argv, intsp, nump) - int argi; - int argc; - char **argv; - unsigned long *intsp; - int *nump; +static int +GetNumbers (int argi, int argc, char **argv, unsigned long *intsp, int *nump) { char *words[256]; int count; @@ -1414,12 +1385,8 @@ int GetNumbers (argi, argc, argv, intsp, nump) return count; } -GetRops (argi, argc, argv, ropsp, nump) - int argi; - int argc; - char **argv; - int *ropsp; - int *nump; +static int +GetRops (int argi, int argc, char **argv, int *ropsp, int *nump) { char *words[256]; int count; diff --git a/x11perf.h b/x11perf.h index b2a415c..d2386ec 100644 --- a/x11perf.h +++ b/x11perf.h @@ -21,9 +21,11 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************************/ +/* $XFree86: xc/programs/x11perf/x11perf.h,v 3.6 2002/12/04 10:28:08 eich Exp $ */ #ifndef VMS #include +#include #include #else #include @@ -32,9 +34,7 @@ SOFTWARE. #if defined(XlibSpecificationRelease) && XlibSpecificationRelease >= 5 #include #endif -#ifndef NULL -#define NULL 0 -#endif +#include #define POLY 1000 /* # (small) items in poly calls */ #define MAXROWS 40 /* Max rows of items in poly calls */ @@ -49,11 +49,6 @@ SOFTWARE. #define BigTile ((char *)2) /* Big tile/stipple */ #define OddTile ((char *)1) /* Odd sized tile/stipple */ -typedef Bool (*InitProc) (/* XParms xp; Parms p */); -typedef void (*Proc) (/* XParms xp; Parms p */); - -extern void NullProc (/* XParms xp; Parms p */); -extern Bool NullInitProc (/* XParms xp; Parms p */); typedef unsigned char Version; @@ -94,8 +89,13 @@ typedef struct _XParms { Bool save_under; int backing_store; unsigned long planemask; + Colormap cmap; } XParmRec, *XParms; +typedef int (*InitProc)(XParms xp, Parms p, int reps); +typedef void (*Proc)(XParms xp, Parms p, int reps); +typedef void (*CleanupProc)(XParms xp, Parms p); + typedef enum { WINDOW, /* Windowing test, rop, planemask have no affect */ ROP, /* Graphics test, rop, planemask has some affect */ @@ -109,19 +109,194 @@ typedef struct _Test { char *label14; /* Labels that are different in Version 1.4 */ InitProc init; /* Initialization procedure */ Proc proc; /* Timed benchmark procedure */ - Proc passCleanup;/* Cleanup between repetitions of same test */ - Proc cleanup; /* Cleanup after test */ + CleanupProc passCleanup;/* Cleanup between repetitions of same test */ + CleanupProc cleanup; /* Cleanup after test */ Version versions; /* Test in 1.2 only, 1.3 only, or both */ TestType testType; /* Windowing, graphics rop, graphics non-rop */ int clips; /* Number of obscuring windows to force clipping*/ ParmRec parms; /* Parameters passed to test procedures */ } Test; +extern void NullProc(XParms xp, Parms p); +extern int NullInitProc(XParms xp, Parms p, int reps); + extern Test test[]; +extern int abortTest; + +extern void AbortTest (void); + +#define CheckAbort() if (abortTest) AbortTest () #define ForEachTest(x) for (x = 0; test[x].option != NULL; x++) +/* do_arcs.c */ +extern int InitCircles ( XParms xp, Parms p, int reps ); +extern int InitPartCircles ( XParms xp, Parms p, int reps ); +extern int InitChordPartCircles ( XParms xp, Parms p, int reps ); +extern int InitSlicePartCircles ( XParms xp, Parms p, int reps ); +extern int InitWideCircles ( XParms xp, Parms p, int reps ); +extern int InitPartWideCircles ( XParms xp, Parms p, int reps ); +extern int InitDashedCircles ( XParms xp, Parms p, int reps ); +extern int InitWideDashedCircles ( XParms xp, Parms p, int reps ); +extern int InitDoubleDashedCircles ( XParms xp, Parms p, int reps ); +extern int InitWideDoubleDashedCircles ( XParms xp, Parms p, int reps ); +extern int InitEllipses ( XParms xp, Parms p, int reps ); +extern int InitPartEllipses ( XParms xp, Parms p, int reps ); +extern int InitChordPartEllipses ( XParms xp, Parms p, int reps ); +extern int InitSlicePartEllipses ( XParms xp, Parms p, int reps ); +extern int InitWideEllipses ( XParms xp, Parms p, int reps ); +extern int InitPartWideEllipses ( XParms xp, Parms p, int reps ); +extern int InitDashedEllipses ( XParms xp, Parms p, int reps ); +extern int InitWideDashedEllipses ( XParms xp, Parms p, int reps ); +extern int InitDoubleDashedEllipses ( XParms xp, Parms p, int reps ); +extern int InitWideDoubleDashedEllipses ( XParms xp, Parms p, int reps ); +extern void DoArcs ( XParms xp, Parms p, int reps ); +extern void DoFilledArcs ( XParms xp, Parms p, int reps ); +extern void EndArcs ( XParms xp, Parms p ); + +/* do_blt.c */ +extern int InitScroll ( XParms xp, Parms p, int reps ); +extern void DoScroll ( XParms xp, Parms p, int reps ); +extern void MidScroll ( XParms xp, Parms p ); +extern void EndScroll ( XParms xp, Parms p ); +extern int InitCopyWin ( XParms xp, Parms p, int reps ); +extern int InitCopyPix ( XParms xp, Parms p, int reps ); +extern int InitGetImage ( XParms xp, Parms p, int reps ); +extern int InitPutImage ( XParms xp, Parms p, int reps ); +extern void DoCopyWinWin ( XParms xp, Parms p, int reps ); +extern void DoCopyPixWin ( XParms xp, Parms p, int reps ); +extern void DoCopyWinPix ( XParms xp, Parms p, int reps ); +extern void DoCopyPixPix ( XParms xp, Parms p, int reps ); +extern void DoGetImage ( XParms xp, Parms p, int reps ); +extern void DoPutImage ( XParms xp, Parms p, int reps ); +#ifdef MITSHM +extern int InitShmPutImage ( XParms xp, Parms p, int reps ); +extern void DoShmPutImage ( XParms xp, Parms p, int reps ); +extern void EndShmPutImage ( XParms xp, Parms p ); +#endif +extern void MidCopyPix ( XParms xp, Parms p ); +extern void EndCopyWin ( XParms xp, Parms p ); +extern void EndCopyPix ( XParms xp, Parms p ); +extern void EndGetImage ( XParms xp, Parms p ); +extern int InitCopyPlane ( XParms xp, Parms p, int reps ); +extern void DoCopyPlane ( XParms xp, Parms p, int reps ); + +/* do_complex.c */ +extern int InitComplexPoly ( XParms xp, Parms p, int reps ); +extern void DoComplexPoly ( XParms xp, Parms p, int reps ); +extern void EndComplexPoly ( XParms xp, Parms p ); +extern int InitGeneralPoly ( XParms xp, Parms p, int reps ); +extern void DoGeneralPoly ( XParms xp, Parms p, int reps ); + +/* do_dots.c */ +extern int InitDots ( XParms xp, Parms p, int reps ); +extern void DoDots ( XParms xp, Parms p, int reps ); +extern void EndDots ( XParms xp, Parms p ); + +/* do_lines.c */ +extern int InitLines ( XParms xp, Parms p, int reps ); +extern int InitWideLines ( XParms xp, Parms p, int reps ); +extern int InitDashedLines ( XParms xp, Parms p, int reps ); +extern int InitWideDashedLines ( XParms xp, Parms p, int reps ); +extern int InitDoubleDashedLines ( XParms xp, Parms p, int reps ); +extern int InitWideDoubleDashedLines ( XParms xp, Parms p, int reps ); +extern void DoLines ( XParms xp, Parms p, int reps ); +extern void EndLines ( XParms xp, Parms p ); + +/* do_movewin.c */ +extern int InitMoveWindows ( XParms xp, Parms p, int reps ); +extern void DoMoveWindows ( XParms xp, Parms p, int reps ); +extern void EndMoveWindows ( XParms xp, Parms p ); +extern void DoResizeWindows ( XParms xp, Parms p, int reps ); +extern int InitCircWindows ( XParms xp, Parms p, int reps ); +extern void DoCircWindows ( XParms xp, Parms p, int reps ); +extern void EndCircWindows ( XParms xp, Parms p ); +extern int InitMoveTree ( XParms xp, Parms p, int reps ); +extern void DoMoveTree ( XParms xp, Parms p, int reps ); +extern void EndMoveTree ( XParms xp, Parms p ); + +/* do_rects.c */ +extern int InitRectangles ( XParms xp, Parms p, int reps ); +extern void DoRectangles ( XParms xp, Parms p, int reps ); +extern void DoOutlineRectangles ( XParms xp, Parms p, int reps ); +extern void EndRectangles ( XParms xp, Parms p ); + +/* do_segs.c */ +extern int InitSegments ( XParms xp, Parms p, int reps ); +extern int InitDashedSegments ( XParms xp, Parms p, int reps ); +extern int InitDoubleDashedSegments ( XParms xp, Parms p, int reps ); +extern int InitHorizSegments ( XParms xp, Parms p, int reps ); +extern int InitWideHorizSegments ( XParms xp, Parms p, int reps ); +extern int InitVertSegments ( XParms xp, Parms p, int reps ); +extern int InitWideVertSegments ( XParms xp, Parms p, int reps ); +extern void DoSegments ( XParms xp, Parms p, int reps ); +extern void EndSegments ( XParms xp, Parms p ); + +/* do_simple.c */ +extern void DoNoOp ( XParms xp, Parms p, int reps ); +extern void DoGetAtom ( XParms xp, Parms p, int reps ); +extern void DoQueryPointer ( XParms xp, Parms p, int reps ); +extern int InitGetProperty ( XParms xp, Parms p, int reps ); +extern void DoGetProperty ( XParms xp, Parms p, int reps ); + +/* do_text.c */ +extern int InitText ( XParms xp, Parms p, int reps ); +extern int InitText16 ( XParms xp, Parms p, int reps ); +extern void DoText ( XParms xp, Parms p, int reps ); +extern void DoText16 ( XParms xp, Parms p, int reps ); +extern void DoPolyText ( XParms xp, Parms p, int reps ); +extern void DoPolyText16 ( XParms xp, Parms p, int reps ); +extern void DoImageText ( XParms xp, Parms p, int reps ); +extern void DoImageText16 ( XParms xp, Parms p, int reps ); +extern void ClearTextWin ( XParms xp, Parms p ); +extern void EndText ( XParms xp, Parms p ); +extern void EndText16 ( XParms xp, Parms p ); +#ifdef XFT +extern int InitAAText (XParms xp, Parms p, int reps ); +extern void DoAAText (XParms xp, Parms p, int reps ); +extern void EndAAText ( XParms xp, Parms p ); +#endif + +/* do_traps.c */ +extern int InitTrapezoids ( XParms xp, Parms p, int reps ); +extern void DoTrapezoids ( XParms xp, Parms p, int reps ); +extern void EndTrapezoids ( XParms xp, Parms p ); +#ifdef XRENDER +extern int InitFixedTrapezoids ( XParms xp, Parms p, int reps ); +extern void DoFixedTrapezoids ( XParms xp, Parms p, int reps ); +extern void EndFixedTrapezoids ( XParms xp, Parms p ); +#endif + +/* do_tris.c */ +extern int InitTriangles ( XParms xp, Parms p, int reps ); +extern void DoTriangles ( XParms xp, Parms p, int reps ); +extern void EndTriangles ( XParms xp, Parms p ); + +/* do_valgc.c */ +extern int InitGC ( XParms xp, Parms p, int reps ); +extern void DoChangeGC ( XParms xp, Parms p, int reps ); +extern void EndGC ( XParms xp, Parms p ); + +/* do_windows.c */ +extern int CreateParents ( XParms xp, Parms p, int reps ); +extern void MapParents ( XParms xp, Parms p, int reps ); +extern void MapParentsCleanup ( XParms xp, Parms p ); +extern int InitCreate ( XParms xp, Parms p, int reps ); +extern void CreateChildren ( XParms xp, Parms p, int reps ); +extern void DestroyChildren ( XParms xp, Parms p ); +extern void EndCreate ( XParms xp, Parms p ); +extern int InitMap ( XParms xp, Parms p, int reps ); +extern void UnmapParents ( XParms xp, Parms p, int reps ); +extern void UnmapParentsCleanup ( XParms xp, Parms p); +extern int InitDestroy ( XParms xp, Parms p, int reps ); +extern void DestroyParents ( XParms xp, Parms p, int reps ); +extern void RenewParents ( XParms xp, Parms p ); +extern int InitPopups ( XParms xp, Parms p, int reps ); +extern void DoPopUps ( XParms xp, Parms p, int reps ); +extern void EndPopups ( XParms xp, Parms p ); + + /***************************************************************************** About x11perf: diff --git a/x11perf.man b/x11perf.man index bfb4c58..f2c78cb 100644 --- a/x11perf.man +++ b/x11perf.man @@ -23,7 +23,10 @@ .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. -.TH X11PERF 1 "Release 6.4" "X Version 11" +.\" +.\" $XFree86: xc/programs/x11perf/x11perf.man,v 1.8 2001/12/14 20:01:14 dawes Exp $ +.\" +.TH X11PERF 1 __xorgversion__ .SH NAME x11perf \- X11 server performance test program .SH SYNTAX @@ -1000,7 +1003,7 @@ Circulate unmapped window to top. .SH X DEFAULTS There are no X defaults used by this program. .SH "SEE ALSO" -X(1), xbench(1), x11perfcomp(1) +X(__miscmansuffix__), xbench(1), x11perfcomp(1) .SH AUTHORS Joel McCormack .br diff --git a/x11perfcomp.man b/x11perfcomp.man index b6a4f6a..9825fe1 100644 --- a/x11perfcomp.man +++ b/x11perfcomp.man @@ -22,7 +22,10 @@ .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. -.TH X11PERFCOMP 1 "Release 6.4" "X Version 11" +.\" +.\" $XFree86: xc/programs/x11perf/x11pcomp.man,v 1.8 2001/12/14 20:01:14 dawes Exp $ +.\" +.TH X11PERFCOMP 1 __xorgversion__ .SH NAME x11perfcomp \- X11 server performance comparison program .SH SYNTAX @@ -72,7 +75,7 @@ Specifies a label file to use. .SH X DEFAULTS There are no X defaults used by this program. .SH "SEE ALSO" -X(1), x11perf(1) +X(__miscmansuffix__), x11perf(1) .SH AUTHORS Mark Moraes wrote the original scripts to compare servers. .br -- cgit v1.2.3