|
|
#include "nfbWinStr.h"void xxxTileRects( BoxPtr pbox, unsigned int nbox, unsigned char *tile, unsigned int stride, unsigned int w, unsigned int h, DDXPointPtr patOrg, unsigned char alu, unsigned long planemask, DrawablePtr pDrawable );
pbox
and nbox
,
filling them with the tile
pointed to by tile
.
Its dimensions are w
and h
.
stride
specifies the number of bytes
from the start of one scan line
to the start of the next scan line within tile
.
patOrg specifies the screen-relative starting position
of the first tile.
All pixel writes must apply alu
and planemask
.
pbox
nbox
count of
BoxRec(D4nfb)
structures
that contain the coordinates of all the rectangles
that must be filled.
pbox[0]
is the first,
pbox[1]
is the second,
and pbox[nbox-1]
is the last.
nbox
tile
tile
points to an unsigned short;
for a 32-bits-per-pixel image,
tile
points to an unsigned int.
stride
tile
for it to point to the next line of the tile image.
See
``stride'' in Developing NFB graphics adapter drivers.
w
w
is not necessarily equivalent to stride
.
h
alu
planemask
patOrg
patOrg->x
and patOrg->y
.
This coordinate is used to ensure that,
when multiple rectangles are filled
in different parts of a window,
the tile patterns will match up if the rectangles overlap.
A simple analogy of this would be
when you are putting wallpaper up and need to make sure that
the wallpaper pattern matches as you paper each strip to the wall.
X requires the ability to fill rectangles with a full pixel tile pattern. If you have an 8 bits-per-pixel display, TileRects( ) is used to fill a series of rectangles with an 8 bits-per-pixel tile. Most graphics adapters have unused video memory when configured to a particular resolution. For example, if the adapter is able to display a resolution of 1024x768 but, because of monitor and other hardware restrictions and conventions, actually uses a 1024x768 display, 256 lines of free memory are available on the graphics adapter. This can be used to improve the performance of drawing routines such as the tile drawer. If no off-screen memory is available, then the genTileRects( ) function should be adequate. In some cases, even if off-screen memory is available, expanding the tile in off-screen memory is actually slower than just using the gen code to fill the rectangles. genTileRects( ) just draws the tile directly to the screen using the DrawImage(D3nfb) and CopyRect(D3nfb) routines.