Fix for big-endian X-servers: rely on server to handle byte/bit order.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@22 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Matt Chapman 2000-10-17 08:24:09 +00:00
parent 6aaf23ce31
commit 4c253c0df7
2 changed files with 5 additions and 21 deletions

View File

@ -742,27 +742,7 @@ static void process_fontcache(STREAM s)
datasize = (height * ((width + 7) / 8) + 3) & ~3;
in_uint8p(s, data, datasize);
/* Need to reverse bit order */
rev_data = xmalloc(datasize);
for (j = 0; j < datasize; j++)
{
in = data[j];
out = 0;
if (in & 1) out |= 128;
if (in & 2) out |= 64;
if (in & 4) out |= 32;
if (in & 8) out |= 16;
if (in & 16) out |= 8;
if (in & 32) out |= 4;
if (in & 64) out |= 2;
if (in & 128) out |= 1;
rev_data[j] = out;
}
bitmap = ui_create_glyph(width, height, rev_data);
xfree(rev_data);
bitmap = ui_create_glyph(width, height, data);
cache_put_font(font, character, offset, baseline,
width, height, bitmap);
}

4
xwin.c
View File

@ -248,6 +248,10 @@ HGLYPH ui_create_glyph(int width, int height, uint8 *data)
image = XCreateImage(display, visual, 1, ZPixmap, 0,
data, width, height, 8, scanline);
image->byte_order = MSBFirst;
image->bitmap_bit_order = MSBFirst;
XInitImage(image);
XSetFunction(display, gc, GXcopy);
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);
XFree(image);