On Tue, Oct 11, 2005 at 05:31:01PM +0900, Carsten Haitzler wrote:
> On Tue, 11 Oct 2005 18:21:25 +1000 Emil Mikulic <[EMAIL PROTECTED]> babbled:
> 
> > On Tue, Oct 11, 2005 at 05:10:53PM +0900, Carsten Haitzler wrote:
> > > aah - but theres 2 bits of endianess handling to be done. 1 at the
> > > rgbaimage level which is what that is fidldign with. the OTHER is at
> > > the ximage ouptut level.
> > 
> > That's what I thought.  Problem at the X interface, not the image
> > loader.
> > 
> > > try display form that ppc box onto your fbsd x86 box :)
> > 
> > Sorry if the previous mail was vague, but we don't have a PPC here.
> > Geoff said that PPC works on the basis of Googling around.  =)
> > 
> > Also, I neglected to mention the screencaps he took were on the Neoware
> > client, which is also x86 (some sort of cut-down Linux running on a VIA
> > Nehemiah board, AFAICT)
> 
> but is the endianess of the xserver different to the client? thats the
> important bit. it seems to me they vary. thats my guess. what needs to be done
> is in rgba.c duplicate macros.routines need to be made that handle the
> byteswapped case and then used if server endianess != client endianess :)
> 

Leafing through the X manpages, it looks like the XImage handlers do
handle byte-reordering provided you set the byte_order of the XImage to
the byte order of the Xserver.

I've altered ximage.c to do this and it works:
http://yallara.cs.rmit.edu.au/~ggiesema/fixed.png

(It's also a really really small patch)

--Geoff
Only in imlib2-fixed/: Makefile
Only in imlib2-fixed/: build.sh
Only in imlib2-fixed/: config.h
Only in imlib2-fixed/: config.log
Only in imlib2-fixed/: config.status
Only in imlib2-fixed/data: Makefile
Only in imlib2-fixed/data/fonts: Makefile
Only in imlib2-fixed/data/images: Makefile
Only in imlib2-fixed/doc: Makefile
Only in imlib2-fixed/: imlib2-config
Only in imlib2-fixed/: imlib2.pc
Only in imlib2-fixed/: libtool
Only in imlib2-fixed/src: Makefile
Only in imlib2-fixed/src/bin: .deps
Only in imlib2-fixed/src/bin: Makefile
Only in imlib2-fixed/src/lib: .deps
Only in imlib2-fixed/src/lib: Makefile
diff -r -U3 imlib2-1.2.1.008/src/lib/rend.c imlib2-fixed/src/lib/rend.c
--- imlib2-1.2.1.008/src/lib/rend.c     2005-07-28 13:06:07.000000000 +1000
+++ imlib2-fixed/src/lib/rend.c 2005-10-12 10:27:34.337683000 +1000
@@ -335,6 +335,7 @@
            free(back);
         return;
      }
+
    /* do a double check in 24/32bpp */
    if ((xim->bits_per_pixel == 32) && (depth == 24))
       actual_depth = 32;
diff -r -U3 imlib2-1.2.1.008/src/lib/ximage.c imlib2-fixed/src/lib/ximage.c
--- imlib2-1.2.1.008/src/lib/ximage.c   2004-11-01 20:45:31.000000000 +1100
+++ imlib2-fixed/src/lib/ximage.c       2005-10-12 10:30:57.718227000 +1000
@@ -323,6 +323,15 @@
      }
    /* flush unused images from the image list */
    __imlib_FlushXImage(d);
+
+   /* set the byte order of the XImage to the byte_order of the Xclient */
+   /* (rather than the Xserver) */
+#ifdef WORDS_BIGENDIAN
+   xim->byte_order = MSBFirst;
+#else
+   xim->byte_order = LSBFirst;
+#endif
+
    /* return out image */
    return xim;
 }

Reply via email to