I got something:
commenting out the call to gdi_color_convert in l_ui_rect in xf_win.c
"fixes" the problem.
static void
l_ui_rect(struct rdp_inst * inst, int x, int y, int cx, int cy, int color)
{
xfInfo * xfi = GET_XFI(inst);
//DEBUG("ui_rect: inst %p x %d y %d cx %d cy %d color %d\n", inst, x, y, cx,
cy, color);
//color = gdi_color_convert(color, inst->settings->server_depth, xfi->bpp,
xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);
XFillRectangle(xfi->display, xfi->drw, xfi->gc, x, y, cx, cy);
if (xfi->drw == xfi->backstore)
{
XFillRectangle(xfi->display, xfi->wnd, xfi->gc, x, y, cx, cy);
}
}
I would like to know:
Can we really assume that the color sent by the server is in the server
depth? Are individual color depths sent in a different format? How would a
16bpp color be sent in an int? I looked at the original color conversion
code from xf_color.c and it appears to be doing just the same.
XSetForeground takes an unsigned long for the color:
http://tronche.com/gui/x/xlib/GC/convenience-functions/XSetForeground.html
Maybe we should use unsigned types everywhere, unlike the original xfreerdp
code that uses ints.
Is XSetForeground expecting the pixel in 32bpp, or 16bpp?
This is for the case where 16bpp is in use in both the server depth, and the
X11 server depth.
On Mon, May 2, 2011 at 2:22 PM, Marc-André Moreau <
[email protected]> wrote:
> I'm working on fixing the problems encountered with color conversion in
> xfreerdp. The code works flawlessly when the X11 server is configured for
> 24bpp, but colors appear to be inverted when the X11 server is configured
> for 16bpp.
>
> I'm wondering if anybody has an idea what could change for 16bpp when the
> server is running in 16bpp instead of 24bpp? Normally, there shouldn't be a
> difference, the destination buffer is supposed to still be 16bpp. I tried
> finding something that could tell me if the buffer is RGB or BGR but
> couldn't find it. Any ideas?
>
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel