Michel Dänzer wrote:

Yes of course, but In the first case the __most__ significant byte of the bits[0] contains data and in the second case the __last__ significant
byte of the bits[0] contains data. So, you obtain swapped pattern0 and pattern1 in the "tile" case.

I see where you're getting at, but does bits[0] really have the same
meaning in both cases?

Yes, I think so.
Let's assume that:
1. bpp = 8, pPixmap->drawable.width = pPixmap->drawable.height = 8;
2. our tile can be reduced to __mono__ 8x8 pattern.

1. stipple case
XAACheckStippleReducibility(PixmapPtr pPixmap)
{
...
CARD32 *IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
CARD32 bits[8];

...
/* for our case i = 8*/
while(i--)
bits[i] = IntPtr[i] & mask; /* where mask = 0xFF000000 */
break;
...
}

intPtr[0] contains valid data in the most significant byte for BE machines, so you
need 0xFF000000 mask to get vaild data from intPtr[0] and put it to
bits[0]. So, the MSB of bits[0] contains first string bitmask of 8x8 pattern.
And I guess there is no any endianity problems here.

2. tile case
XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono)
{
CARD32 *IntPtr;
...

if(checkMono) {
...
if(pPixmap->drawable.bitsPerPixel == 8) {
/* this is our case */
unsigned char *srcp = pPixmap->devPrivate.ptr;
...
/* i = j = 8 for our case */
for(y = 0; y < i; y++) {
bits[y] = 0;
for(x = 0; x < j; x++) {
if(srcp[x] != fg) {
/* return if there is more then to colors in tile */
if(bg == -1) bg = srcp[x];
else if(bg != srcp[x]) return TRUE;
} else bits[y] |= 1 << x;
}
srcp += pitch;
}
...

In this case bits[0] also contains the first string of 8x8 pattern
(as I understand), but in the last significant byte (bits[0] & 0x000000FF).

... but maybe there is a problem in code were pPixmap->devPrivate.ptr
is filled.

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to