diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-09-13 11:50:40 +0200 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-09-13 11:50:43 +0200 |
commit | 0815fb06f1135f6f276d2d534a569e6b10b52241 (patch) | |
tree | fa8c74256f2a51568a92c0510e7fae6acaed3c15 /nx-X11/programs/Xserver/hw | |
parent | 81569ad6b58d51cc2691f075d70f89fe470a48eb (diff) | |
download | nx-libs-0815fb06f1135f6f276d2d534a569e6b10b52241.tar.gz nx-libs-0815fb06f1135f6f276d2d534a569e6b10b52241.tar.bz2 nx-libs-0815fb06f1135f6f276d2d534a569e6b10b52241.zip |
nx-X11/programs/Xserver/hw/nxagent/Render.c: use macros obtaining values from _XPrivDisplay instead of the other Display structure directly.
Fixes: ArcticaProject/nx-libs#512
It's unclear to me why (Display*)(dpy)->bitmap_pad and
(_XPrivDisplay)(dpy)->bitmap_pad produce different results.
Technically, Display is referencing the _XDisplay/Display structure
defined in Xlibint.h, while _XPrivDisplay is a typedef'd pointer to the
(anonymous) structure defined in Xlib.h, since we're not defining the
XLIB_ILLEGAL_ACCESS macro. The weird part is that both should be equal
when it comes to its bitmap_pad, byte_order and bitmap_bit_order
members.
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Render.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index cf1d0ed07..e71004acd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -226,7 +226,7 @@ nxagentCleanGlyphs(xGlyphInfo *gi, #ifdef DEBUG fprintf(stderr, "nxagentCleanGlyphs: Found a Glyph with Depth %d, width %d, pad %d.\n", - depth, gi -> width, dpy -> bitmap_pad); + depth, gi -> width, BitmapPad(dpy)); #endif while (nglyphs > 0) @@ -235,7 +235,7 @@ nxagentCleanGlyphs(xGlyphInfo *gi, { widthInBits = gi -> width * 32; - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); + bytesPerLine = ROUNDUP(widthInBits, BitmapPad(dpy)); bytesToClean = bytesPerLine * height; @@ -245,7 +245,7 @@ nxagentCleanGlyphs(xGlyphInfo *gi, widthInBits, bytesPerLine, height); #endif - if (dpy -> byte_order == LSBFirst) + if (ImageByteOrder(dpy) == LSBFirst) { for (i = 3; i < bytesToClean; i += 4) { @@ -279,7 +279,7 @@ nxagentCleanGlyphs(xGlyphInfo *gi, { widthInBits = gi -> width; - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); + bytesPerLine = ROUNDUP(widthInBits, BitmapPad(dpy)); bitsToClean = (bytesPerLine << 3) - (gi -> width); @@ -295,19 +295,19 @@ nxagentCleanGlyphs(xGlyphInfo *gi, #ifdef DEBUG fprintf(stderr, "nxagentCleanGlyphs: bitsToClean &=7 is %d, bytesToCLean is %d." " byte_order is %d, bitmap_bit_order is %d.\n", bitsToClean, bytesToClean, - dpy -> byte_order, dpy -> bitmap_bit_order); + ImageByteOrder(dpy), BitmapBitOrder(dpy)); #endif for (i = 1; i <= height; i++) { - if (dpy -> byte_order == dpy -> bitmap_bit_order) + if (ImageByteOrder(dpy) == BitmapBitOrder(dpy)) { for (j = 1; j <= bytesToClean; j++) { images[i * bytesPerLine - j] = 0x00; #ifdef DEBUG - fprintf(stderr, "nxagentCleanGlyphs: byte_order = bitmap_bit_orde, cleaning %d, i=%d, j=%d.\n" + fprintf(stderr, "nxagentCleanGlyphs: byte_order == bitmap_bit_order, cleaning %d, i=%d, j=%d.\n" , (i * bytesPerLine - j), i, j); #endif @@ -321,13 +321,13 @@ nxagentCleanGlyphs(xGlyphInfo *gi, #ifdef DEBUG fprintf(stderr, "nxagentCleanGlyphs: byte_order %d, bitmap_bit_order %d, cleaning %d, i=%d, j=%d.\n" - , dpy -> byte_order, dpy -> bitmap_bit_order, (i * bytesPerLine - j), i, j); + , ImageByteOrder(dpy), BitmapBitOrder(dpy), (i * bytesPerLine - j), i, j); #endif } } - if (dpy -> bitmap_bit_order == MSBFirst) + if (BitmapBitOrder(dpy) == MSBFirst) { images[i * bytesPerLine - j] &= 0xff << bitsToClean; @@ -366,7 +366,7 @@ nxagentCleanGlyphs(xGlyphInfo *gi, { widthInBits = gi -> width * depth; - bytesPerLine = ROUNDUP(widthInBits, dpy -> bitmap_pad); + bytesPerLine = ROUNDUP(widthInBits, BitmapPad(dpy)); widthInBytes = (widthInBits >> 3); |