Index: programs/x11perf/do_tests.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_tests.c,v retrieving revision 1.3 diff -u -p -r1.3 do_tests.c --- programs/x11perf/do_tests.c 6 Aug 2004 23:42:11 -0000 1.3 +++ programs/x11perf/do_tests.c 28 Oct 2004 16:51:38 -0000 @@ -1042,6 +1042,10 @@ Test test[] = { InitAAText, DoAAText, ClearTextWin, EndAAText, V1_5FEATURE, NONROP, 0, {80, 12, "courier:antialias=true:rgba=rgb:pixelsize=12", NULL}}, + {"-srgbftext", "Single Char in 80-char rgb line (Courier 12)", NULL, + InitAAText, DoAATextS, 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, Index: programs/x11perf/do_text.c =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/do_text.c,v retrieving revision 1.2 diff -u -p -r1.2 do_text.c --- programs/x11perf/do_text.c 23 Apr 2004 19:54:38 -0000 1.2 +++ programs/x11perf/do_text.c 28 Oct 2004 16:51:38 -0000 @@ -28,7 +28,7 @@ SOFTWARE. static char **charBuf; static XFontStruct *font, *bfont; -static int height, ypos; +static int width, height, ypos; static XTextItem *items; static int charsPerLine, totalLines; @@ -59,9 +59,13 @@ InitText(XParms xp, Parms p, int reps) } ypos = XPOS; + width = font->max_bounds.width + 1; height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; if (bfont != NULL) { + int w = bfont->max_bounds.width + 1; int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; + if (w > width) + width = w; if (h > height) height = h; } @@ -155,9 +159,13 @@ InitText16(XParms xp, Parms p, int reps) } ypos = XPOS; + width = font->max_bounds.width + 1; height = (font->max_bounds.ascent + font->max_bounds.descent) + 1; if (bfont != NULL) { + int w = bfont->max_bounds.width + 1; int h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1; + if (w > width) + width = w; if (h > height) height = h; } @@ -450,6 +458,7 @@ InitAAText(XParms xp, Parms p, int reps) } ypos = XPOS; + width = aafont->max_advance_width; height = aafont->height; charsPerLine = p->objects; @@ -495,6 +504,32 @@ DoAAText(XParms xp, Parms p, int reps) } void +DoAATextS(XParms xp, Parms p, int reps) +{ + int i, j, line, startLine, xpos; + + startLine = 0; + line = 0; + for (i = 0; i != reps; i++) { + xpos = XPOS; + for (j = 0; j < charsPerLine; j++) { + XftDrawString8 (aadraw, &aacolor, aafont, + xpos, ypos, (unsigned char *) &charBuf[line][j], 1); + xpos += width; + } + 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; Index: programs/x11perf/x11perf.h =================================================================== RCS file: /cvs/xorg/xc/programs/x11perf/x11perf.h,v retrieving revision 1.3 diff -u -p -r1.3 x11perf.h --- programs/x11perf/x11perf.h 6 Aug 2004 23:42:11 -0000 1.3 +++ programs/x11perf/x11perf.h 28 Oct 2004 16:51:38 -0000 @@ -255,6 +255,7 @@ extern void EndText16 ( XParms xp, Parms #ifdef XFT extern int InitAAText (XParms xp, Parms p, int reps ); extern void DoAAText (XParms xp, Parms p, int reps ); +extern void DoAATextS (XParms xp, Parms p, int reps ); extern void EndAAText ( XParms xp, Parms p ); #endif