Re: [gtk-vnc-devel] [PATCH] Fix little to big endian conversion



On Thu, Feb 07, 2008 at 09:21:17AM +0900, Hiroyuki Kaguchi wrote:
> When the endian between VNC server and X server is different, the displayed color is abnormal.
> This is because the endian conversion of the pixel data is not done .
> 
> X server that uses big endian cannot be used.
> The reason is that most Linux vncserver sends data by little endian.
> 
> Of course, Fedora8(Linux) and Windows(Xming) works fine, since it uses
> little endian for X protocol.
> 
> This patch applies follows:
> (a)The endian conversion function is called by the SET_PIXEL function.
> (b)It is checked whether there is difference in endian between X server and VNC Server.
> (c)The byte_order variable is added to the gvnc_framebuffer structure.
> 
> Sign-off-by: Hiroyuki Kaguchi <fj7025cf aa jp fujitsu com>
> 
> 

I don't think removing this hunk is correct:

> @@ -3001,13 +3002,6 @@ gboolean gvnc_set_local(struct gvnc *gvn
>  	for (n = gvnc->fmt.blue_max; n > gvnc->local.blue_mask ; n>>= 1)
>  		gvnc->brs++;
>  
> -	/* This adjusts for remote having less bpp than remote */
> -	for (n = gvnc->local.red_mask ; n > gvnc->fmt.red_max ; n>>= 1)
> -		gvnc->rls++;
> -	for (n = gvnc->local.green_mask ; n > gvnc->fmt.green_max ; n>>= 1)
> -		gvnc->gls++;
> -	for (n = gvnc->local.blue_mask ; n > gvnc->fmt.blue_max ; n>>= 1)
> -		gvnc->bls++;
>  	GVNC_DEBUG("Pixel shifts\n   right: %3d %3d %3d\n    left: %3d %3d %3d\n",
>  		   gvnc->rrs, gvnc->grs, gvnc->brs,
>  		   gvnc->rls, gvnc->gls, gvnc->bls);

IIRC, this will cause screwed up colours when server is 24bpp vs
the viewer 16bpp, or vica-verca.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]