Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 1995 13:07:10 -0700
From:      Steve Passe <smp@ilsa.systemsix.com>
To:        ports@freebsd.org
Message-ID:  <199511172007.NAA12598@ilsa.systemsix.com>

next in thread | raw e-mail | index | archive | help
Hi,

> * + /* xdpyinfo:  red, green, blue masks:    0xf800, 0x7e0, 0x1f */
> * +                       temp = ( (colrs[(int)*datap].red          & 0xf800) |
> * +                               ((colrs[(int)*datap].green >>  5) & 0x07e0) |
>
>I'm afraid this will work only for "Weight=565" case.  Isn't there a
>function to query this?

I'm not an X11 guru, but my experimentation shows that if you use
the "Weight=555"  case that Mosaic finds the depth to be 15 and thus
completely fails to display the image.  The complete solution would
be:

 change the 'case 16:' to 'case 15:' and leave the existing 'case
  16:' (now 'case 15:') code in place.

 add a new 'case 16:' with my modified lines.

in other words, the existing code probably works for depth 15,
weight 555.  my changes work for depth 16, weight 565.

If you use depth 16, weight 555, X converts the depth to 15.
Using depth 15, weight 565 should be illegal.

If you use depth 15, no weight, X defaults to weight 555.
If you use depth 16, no weight, X defaults to weight 565.

So, if you use the change I suggest above, I think Mosaic will work
for all cases, based on its switch statement for queried depth.

Having said all this I went and made the following patch file:

------------------------------------ cut --------------------------------------
*** src/pixmaps.c.orig	Thu Feb  2 17:56:46 1995
--- src/pixmaps.c	Fri Nov 17 12:21:32 1995
***************
*** 397,412 ****
  	     * TrueColor displays.  I have no access to such displays, so I
  	     * can't really test it.
  	     * Donated by - andrew@icarus.demon.co.uk
  	     */
  	    case 16:
  		bit_data = (unsigned char *)malloc(size * 2);
  		bitp = bit_data;
  		datap = data;
  		for (w = size; w > 0; w--)
  		{
! 			temp = (((colrs[(int)*datap].red   >> 1) & 0x7c00) |
! 				((colrs[(int)*datap].green >> 6) & 0x03e0) |
! 				((colrs[(int)*datap].blue  >> 11) & 0x001f));
  
  			if (BitmapBitOrder(XtDisplay(wid)) == MSBFirst)
  			{
--- 397,429 ----
  	     * TrueColor displays.  I have no access to such displays, so I
  	     * can't really test it.
  	     * Donated by - andrew@icarus.demon.co.uk
+ 	     * modified by smp@csn.net for XFree86-3.1.x
  	     */
+ 	    case 15:
  	    case 16:
  		bit_data = (unsigned char *)malloc(size * 2);
  		bitp = bit_data;
  		datap = data;
  		for (w = size; w > 0; w--)
  		{
! 			if (depth == 15) /* weight == 555 */
! 			{
! 				temp = (((colrs[(int)*datap].red   >> 1)
! 					 & 0x7c00) |
! 					((colrs[(int)*datap].green >> 6)
! 					 & 0x03e0) |
! 					((colrs[(int)*datap].blue  >> 11)
! 					 & 0x001f));
! 		    	}
! 			else /* depth == 16, weight == 565 */
! 			{
! 				temp = ( (colrs[(int)*datap].red
! 					  & 0xf800) |
! 					((colrs[(int)*datap].green >>  5)
! 					 & 0x07e0) |
! 					((colrs[(int)*datap].blue  >> 11)
! 					 & 0x001f));
! 			}
  
  			if (BitmapBitOrder(XtDisplay(wid)) == MSBFirst)
  			{
*** libhtmlw/HTMLimages.c.orig	Tue Jan 10 17:03:32 1995
--- libhtmlw/HTMLimages.c	Fri Nov 17 12:27:58 1995
***************
*** 356,371 ****
  	     * TrueColor displays.  I have no access to such displays, so I
  	     * can't really test it.
  	     * Donated by - andrew@icarus.demon.co.uk
  	     */
  	    case 16:
  		bit_data = (unsigned char *)malloc(width * height * 2);
  		bitp = bit_data;
  		datap = data;
  		for (w = (width * height); w > 0; w--)
  		{
! 			temp = (((img_info->reds[(int)*datap] >> 1)& 0x7c00) |
! 				((img_info->greens[(int)*datap] >> 6)& 0x03e0) |
! 				((img_info->blues[(int)*datap] >> 11)& 0x001f));
  
  			if (BitmapBitOrder(dsp) == MSBFirst)
  			{
--- 356,388 ----
  	     * TrueColor displays.  I have no access to such displays, so I
  	     * can't really test it.
  	     * Donated by - andrew@icarus.demon.co.uk
+ 	     * modified by smp@csn.net for XFree86-3.1.x
  	     */
+ 	    case 15:
  	    case 16:
  		bit_data = (unsigned char *)malloc(width * height * 2);
  		bitp = bit_data;
  		datap = data;
  		for (w = (width * height); w > 0; w--)
  		{
! 			if (depth == 15) /* weight == 555 */
! 			{
! 				temp = (((img_info->reds[(int)*datap] >> 1)
! 					 & 0x7c00) |
! 					((img_info->greens[(int)*datap] >> 6)
! 					 & 0x03e0) |
! 					((img_info->blues[(int)*datap] >> 11)
! 					 & 0x001f));
! 		    	}
! 			else /* depth == 16, weight == 565 */
! 			{
! 				temp = ((img_info->reds[(int)*datap]
! 					 & 0xf800) |
! 					((img_info->greens[(int)*datap] >> 5)
! 					 & 0x07e0) |
! 					((img_info->blues[(int)*datap] >> 11)
! 					 & 0x001f));
! 			}
  
  			if (BitmapBitOrder(dsp) == MSBFirst)
  			{
------------------------------------ cut --------------------------------------

I deleted the Mosaic pkg, rm -rf Mosaic/work, added the above patch as
patch-ae to Mosaic/patches, did a 'make' and (as root) 'make install'.

I restarted XF86 as 'depth 15', verified depth via xdpyinfo,
 tested Mosaic, it worked.

I restarted XF86 as 'depth 16', verified depth via xdpyinfo,
 tested Mosaic, it worked.


--
Steve Passe	| powered by
smp@csn.net	|            FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511172007.NAA12598>