Commit 82a6e01a authored by Kaleb Keithley Keithley's avatar Kaleb Keithley Keithley
Browse files

Initial revision

parents
Bugs found with xbench
----------------------
Lines, FillStyle Solid, Planemask 0, LineWidth 0 - draws lines anyways.
other FillStyles work correctly.
Rectangles - same problem.
Filled Rectangles, FillStyle other than OpaqueStippled, Planemask 0 - draws
rectangles anyways.
OpaqueStippled works fine.
Dashed Lines - sometimes hangs.
only happens when lots of lines/short dashes/long lines.
Lines, Function equiv, LineWidth > 1 - copies instead of equiving.
General concerns
----------------
Machine type
Display type
Display on different machine?
Visual
Clipping
Obscured by cursor
Background tiling
The whole software vs. hardware bit: computational overhead vs. time spent
drawing
Planemask
PolyFillRectangle
-----------------
Use same test as PolyRectangle?
Perhaps give FillPoly some of these too, see if it special cases them.
Fill Rectangle vs. Fill Poly for same size areas would be an
interesting comparison.
Things to look for:
All it's really doing is setting or unsetting planes.
When a whole word is filled, it should be quite fast (just
setting it to 0 or ~0).
Otherwise, the speed of a single rectangle should be about
equal to its size.
Data:
Pixels per second.
Average size of rectangle.
GC fields:
function:
Tiling: likely to be a lot slower, although for whole words
you're just setting it to a certain value, rather than 0.
(You also have to look at the y value). Strange width
tiles (are these allowed?) are likely to be real bad.
Stippling: also slower - I'm not sure whether or not this would
be slower than tiling. This probably has a greater
chance of being done in hardware.
plane-mask:
plane of 0 would be real fast, since it doesn't modify
anything. plane of ~0 should be fast, since it doesn't
have to think. Anything else would probably be
proportional to the number of planes...
subwindow-mode: I don't believe it matters.
clip-x-origin
clip-y-origin
clip-mask:
Clipping in general should probably increase speed rather
than decrease it, unless the clipping region is strange.
Possible increase in speed because less change to the
display is being made; possible decrease in speed because
more thought has to be given to what is drawn or not.
Software vs. hardware, I suppose.
Possibly
foreground: similar to plane-mask in its effect, I would think.
tile: "nice" width tiles would probably be better. A width which
is not a divisor of the length of a word would be
significantly slower. A width the size of a word is
probably perfect. The actual contents of the tile
probably don't matter: Any code to check for tiles
which could be "simplified" would probably take too much
time to execute to do any good.
stipple: like tile
Other:
alignment on word bounaries: fastest when one is changing whole
words at a time. That way, you're just setting whole words to
0 or ~0 and not doing any computation. A 32x1 rectangle should
be much faster than a 1x32 rectangle.
---------
Things to put in test:
Check all alignments.
Perhaps some sort of comparison between thin rectangles oriented
horizontally and oriented vertically.
Small rectangles, big rectangles: compare pixels/second for each.
Good way of computing overhead costs.
---------
test
(1-32)x32 at all 32 bits in a word.
(97-128)x32
(97-128)x128
The command buttons at the top -
Benchmark Options, Graphics Options, etc.
should just bring up the window, not force you to use it.
1) It is nicer to the person who might want to have both up at once.
2) It is nicer to the programmer who doesn't know how to focus events.
The Commands menu should contain the following items:
Run [the selected benchmark]
Benchmark Options.../Hide Benchmark Options [toggle]
Graphics Options.../Hide Graphics Options [toggle]
Describe Test.../Hide Test Description [toggle]
Start Recording/Stop Recording [toggle]
Playback [pop up a dialogue box asking for filename]
--------
Quit [pop up a dialogue box asking if we are really done]
The Benchmark Options sheet should contain the information shown below. The
list of graphics primitives was derived from the "Definition of the Porting
Layer for the X v11 Sample Server" by Angebranndt et al. and from the Protocol
document.
Benchmark Options
+-----------------------+-----------------------+
Test | Copy Area | Copy Plane |
+-----------------------+-----------------------+
| Points | Lines |
+-----------------------+-----------------------+
| Segments | Rectangles |
+-----------------------+-----------------------+
| Arcs | Filled Polygons |
+-----------------------+-----------------------+
| Filled Rectangles | Filled Arcs |
+-----------------------+-----------------------+
| Put Image | Get Image |
+-----------------------+-----------------------+
| Text 8 | Image Text 8 |
+-----------------------+-----------------------+
| Text 16 | Image Text 16 |
+-----------------------+-----------------------+
+---------+
Iterations | 10000 |
+---------+
+----+-----+ +----+-----+
Record | on | off | Describe Test | on | off |
+----+-----+ +----+-----+
+-----------------------------------------------+
Filename | ./xbench.log |
+-----------------------------------------------+
*******************************************************************************
The Graphics Options area would contain the following entries:
Function - one-of { clear, and, andReverse, copy, andInverted, noop, xor,
or, nor, equiv, invert, orReverse, copyInverted,
orInverted, nand, set }
PlaneMask - unsigned value or many-of-n representing bits
Foreground - unsigned value in range 0..2^nplanes
Background - unsigned value in range 0..2^nplanes
ForegroundColor - set rgb value of Foreground
BackgroundColor - set rgb value of background
LineWidth - unsigned number in range 0..65535
LineStyle - oneof { Solid, OnOffDash, DoubleDash }
CapStyle - one-of { NotLast, Butt, Round, Projecting }
JoinStyle - one-of { Miter, Round, Bevel }
FillStyle - one-of { Solid, Tiled, OpaqueStippled, Stippled }
FillRule - one-of { EvenOdd, Winding }
ArcMode - one-of { Chord, PieSlice }
# Tile - pixmap [probably not edittable in first version]
# Stipple - pixmap [probably not edittable in first version]
TileStipXOrigin - signed number in range -32768..32767
TileStipYOrigin - signed number in range -32768..32767
Font - name of font
ClipXOrigin - signed number in range -32768..32767
ClipYOrigin - signed number in range -32768..32767
ClipMask - one-of { None, select } [user selects by clicking in work area]
DashOffset - unsigned number in range -32768..32767
DashList - many-of-n of 8 boxes for defining dashes
Graphics Options
+--------------+--------------+--------------+--------------+
Function | clear | and | andReverse | copy |
+--------------+--------------+--------------+--------------+
| andInverted | noop | xor | or |
+--------------+--------------+--------------+--------------+
| nor | equiv | invert | orReverse |
+--------------+--------------+--------------+--------------+
| copyInverted | orInverted | nand | set |
+--------------+--------------+--------------+--------------+
+-----+---------+
Colormap | new | default |
+-----+---------+
+----------+ +--------+--------+--------+
Foreground | 1 | ForegroundColor | ffff | ffff | ffff |
+----------+ +--------+--------+--------+
+----------+ +--------+--------+--------+
Background | 0 | BackgroundColor | 0000 | 0000 | 0000 |
+----------+ +--------+--------+--------+
+------+ +-------+-----------+------------+
LineWidth | 3 | LineStyle | Solid | OnOffDash | DoubleDash |
+------+ +-------+-----------+------------+
+---------+------+-------+------------+
CapStyle | NotLast | Butt | Round | Projecting |
+---------+------+-------+------------+
+-------+-------+-------+
JoinStyle | Miter | Round | Bevel |
+-------+-------+-------+
+-------+-------+----------+----------------+
FillStyle | Solid | Tiled | Stippled | OpaqueStippled |
+-------+-------+----------+----------------+
+---------+---------+
FillRule | EvenOdd | Winding |
+---------+---------+
+-------+----------+
ArcMode | Chord | PieSlice |
+-------+----------+
+--------------+
TStipOrigin | +####, +#### |
+--------------+
+-+-+-+-+-+-+-+-+ +-------+
DashList | | |X|X| | |X|X| DashOffset | +#### |
+-+-+-+-+-+-+-+-+ +-------+
+----+-----+-----+-------+ +--------+
ClipMask | on | off | set | clear | PlaneMask | ffff |
+----+-----+-----+-------+ +--------+
*******************************************************************************
Grammar
Both to support Record/Playback (used for debugging, demonstrations, and for
creating benchmark scripts), there needs to be a command line language that
can be used to set all options. Although we won't be doing anything as
sophisticated as what is provided in many UIMS's, it would be nice to keep
the application section of the benchmark as separate as possible from the
user interface.
test { CopyArea, CopyPlane, PolyPoint, PolyLine, PolySegment,
PolyRectangle, PolyArc, FillPolygon, PolyFillRect, PolyFillArc,
PutImage, GetImage, ImageText8, PolyText8, ImageText16,
PolyText16 }
- selects the test to be performed.
colormap { new, default }
- selects which colormap should be used for test
iterations UNSIGNEDNUMBER
- specifies the number of times that the test should be run.
record BOOLEAN
- indicates whether or not to record commands into the record-file.
record-file FILENAME
- specifies the name of the file into which commands are recorded.
describe BOOLEAN
- indicates whether or not a description of the test should be
displayed whenever a test is selected (or when this option is
specified).
function { clear, and, andReverse, copy, andInverted, noop, xor, or, nor,
equiv, invert, orReverse, copyInverted, orInverted, nand, set }
- selects the alu function to use in the GC.
foreground UNSIGNEDNUMBER
- selects the foreground pixel value to use in the GC; if a new
colormap is being used, the RGB value for this slot may be changed.
background UNSIGNEDNUMBER
- selects the background pixel value to use in the GC; if a new
colormap is being used, the RGB value for this slot may be changed.
forecolor COLORNAME
- specifies the RGB value or name of the color to be used for the
foreground pixel, if settable.
backcolor COLORNAME
- specifies the RGB value or name of the color to be used for the
background pixel, if settable.
linewidth NUMBER
- specifies width of lines to use in the GC.
linestyle { Solid, OnOffDash, DoubleDash }
- selects the type of lines to use in the GC.
capstyle { NotLast, Butt, Round, Projecting }
- selects the type of caps to use in the GC.
joinstyle { Miter, Round, Bevel }
- selects the type of joins to use in the GC.
fillstyle { Solid, Tiled, Stippled, OpaqueStippled }
- selects the type of fills to use in the GC.
fillrule { EvenOdd, Winding }
- selects the fill rule to be used in the GC.
arcmode { Chord, PieSlice }
- selects the type of arcs to be drawn in the GC.
tsorigin NUMBER NUMBER
- specifies the X and Y values of the TileStippleOrigin in the GC.
dashlist DASHPATTERN
- specifies a pattern of 8 binary digits to use in the dashlist
in the GC; the characters are given in big-endian order such that
they may be read in binary to form a number between 0 and 255.
dashoffset NUMBER
- specifies the dashoffset to use in the GC.
cliporigin NUMBER NUMBER
- specifies the X and Y values of the cliporigin in the GC.
clipmask { on, off, set NUMBER NUMBER NUMBER NUMBER, clear }
- selects a clipping mode. If "on", then use the most recently
defined set of clipping rectangles; if "off", then do not do
any clipping but keep the clipping rectangles for future
reference; if "set", then add the rectangle specified by
the remaining numeric arguments as X1 Y1 X2 Y2 relative to the
cliporigin.
planemask NUMBER
- specifies the set of planes on to which graphics may be drawn
in the GC.
run
- run the currently configured test.
quit
- exit the program
ClearArea
---------
Basically a special case of PolyFillRect. Put up some sort of image first
so we can clear it away. Try both small areas and big areas, to give
credit to servers for optimizing small ones.
Data: Pixels per second.
Breaking that down into large and small areas would probably not
be userful.
GC Fields: None.
CopyArea
--------
Putting up some image and then repeatedly copying from one part of it
to another would do the right thing and could look neat if done right.
We probably want to see what happens when the source area is clipped,
as that as mentioned specifically in the protocol document.
Data: Pixels per second.
GC Fields: function (*)
plane-mask
subwindow-mode
graphics-exposures
clip-x-origin
clip-y-origin
clip-mask
CopyPlane
---------
Special case of CopyArea again.
PolyPoint
---------
Draw lots of points.
Either start out with an image that's 50/50 black and white
(preferred) or draw enough points that some points will get drawn at
least twice (to test functions other than copy).
Data: Points per second.
GC fields: function (*)
plane-mask
foreground
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
PolyLine
--------
Circular test like there is now.
Try clipping at window boundaries?
Data: Lines per second.
Pixels per second (is this valid - do lines that are twice as
long take twice as long to draw? Also, is it valid to compare
thin lines and fat lines?)
GC fields: function (*)
plane-mask
line-width (*)
line-style (*)
cap-style (*)
join-style (*)
fill-style (*)
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile (*)
stipple (*)
tile-stipple-x-origin
tile-stipple-y-origin
dash-offset
dashes (*)
PolySegment
-----------
Just like PolyLine but lines don't have to be connected. Crosshatching?
Data: Lines per second, pixels per second(?)
GC fields: function
plane-mask
line-width
line-style
cap-style
fill-style
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
dash-offset
dashes
PolyRectangle
-------------
Lots of five point PolyLines. Partly concentric ones would look nice; we
also need overlap for testing different functions.
Data: Rectangles per second.
Pixels per second? (divide by perimeter)
GC fields: function
plane-mask
line-width
line-style
join-style
fill-style
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
dash-offset
dashes
PolyArc
-------
Overlapping concentric things (ripples) would look cool.
Is it possible to special-case circles? Test for this?
Data: Arcs per second? If we had the same test each time this might
be OK.
Pixels per second? Finding the length of an arc could be
annoying.
GC fields: function
plane-mask
line-width
line-style
cap-style
join-style
fill-style
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
dash-offset
dashes
FillPoly
--------
Use the same test as PolyLine?
Overlapping is a must to test functions.
Convex vs. Concave polygons.
Data: Pixels per second, I guess.
Data for convex vs. concave could be interesting.
GC fields: function
plane-mask
fill-style
fill-rule
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
PolyFillRectangle
-----------------
Use same test as PolyRectangle?
Perhaps give FillPoly some of these too, see if it special cases them.
Fill Rectangle vs. Fill Poly for same size areas would be an
interesting comparison.
Data: Pixels per second.
GC fields: function
plane-mask
fill-style
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
PolyFillArc
-----------
Use same test as PolyArc?
Data: Pixels per second would be hard to compute, but what else is there?
GC fields: function
plane-mask
fill-style
arc-mode
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
PutImage
--------
GC fields: function
plane-mask
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
GetImage
--------
PolyText8
---------
GC fields: function
plane-mask
fill-style
font
subwindow-mode
clip-x-origin
clip-y-origin
clip-mask
Possibly foreground
background
tile
stipple
tile-stipple-x-origin
tile-stipple-y-origin
PolyText16
----------
ImageText8
----------
GC fields: plane-mask
foreground
background
font
subwindow-mode
clip-x-origin