Skip to content
Browse files

correct colors for 16-bit displays

  • Loading branch information...
1 parent 2f58220 commit d588e30a3873073e4ab76078ea27a61ada9922dd @meosborne meosborne committed Mar 2, 2012
Showing with 10 additions and 10 deletions.
  1. +4 −4 client/X11/xf_gdi.c
  2. +4 −4 client/X11/xf_graphics.c
  3. +2 −2 libfreerdp-codec/color.c
View
8 client/X11/xf_gdi.c
@@ -438,7 +438,7 @@ void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
uint32 color;
xfInfo* xfi = ((xfContext*) context)->xfi;
- color = freerdp_color_convert_var(opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
+ color = freerdp_color_convert_var(opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@@ -468,7 +468,7 @@ void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult
DELTA_RECT* rectangle;
xfInfo* xfi = ((xfContext*) context)->xfi;
- color = freerdp_color_convert_var(multi_opaque_rect->color, xfi->srcBpp, 32, xfi->clrconv);
+ color = freerdp_color_convert_var(multi_opaque_rect->color, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
@@ -553,7 +553,7 @@ void xf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, polyline->bRop2);
- color = freerdp_color_convert_var(polyline->penColor, xfi->srcBpp, 32, xfi->clrconv);
+ color = freerdp_color_convert_var(polyline->penColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);
@@ -711,7 +711,7 @@ void xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
xfInfo* xfi = ((xfContext*) context)->xfi;
xf_set_rop2(xfi, polygon_sc->bRop2);
- brush_color = freerdp_color_convert_var(polygon_sc->brushColor, xfi->srcBpp, 32, xfi->clrconv);
+ brush_color = freerdp_color_convert_var(polygon_sc->brushColor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
npoints = polygon_sc->numPoints + 1;
points = xmalloc(sizeof(XPoint) * npoints);
View
8 client/X11/xf_graphics.c
@@ -274,12 +274,12 @@ void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height
xfInfo* xfi = ((xfContext*) context)->xfi;
bgcolor = (xfi->clrconv->invert)?
- freerdp_color_convert_var_bgr(bgcolor, xfi->srcBpp, 32, xfi->clrconv):
- freerdp_color_convert_var_rgb(bgcolor, xfi->srcBpp, 32, xfi->clrconv);
+ freerdp_color_convert_var_bgr(bgcolor, xfi->srcBpp, xfi->bpp, xfi->clrconv):
+ freerdp_color_convert_var_rgb(bgcolor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
fgcolor = (xfi->clrconv->invert)?
- freerdp_color_convert_var_bgr(fgcolor, xfi->srcBpp, 32, xfi->clrconv):
- freerdp_color_convert_var_rgb(fgcolor, xfi->srcBpp, 32, xfi->clrconv);
+ freerdp_color_convert_var_bgr(fgcolor, xfi->srcBpp, xfi->bpp, xfi->clrconv):
+ freerdp_color_convert_var_rgb(fgcolor, xfi->srcBpp, xfi->bpp, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
View
4 libfreerdp-codec/color.c
@@ -339,15 +339,15 @@ uint32 freerdp_color_convert_var_rgb(uint32 srcColor, int srcBpp, int dstBpp, HC
if (srcBpp > 16)
return freerdp_color_convert_bgr_rgb(srcColor, srcBpp, 32, clrconv);
else
- return freerdp_color_convert_rgb(srcColor, srcBpp, 32, clrconv);
+ return freerdp_color_convert_rgb(srcColor, srcBpp, dstBpp, clrconv);
}
uint32 freerdp_color_convert_var_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (srcBpp > 16)
return freerdp_color_convert_bgr(srcColor, srcBpp, 32, clrconv);
else
- return freerdp_color_convert_rgb_bgr(srcColor, srcBpp, 32, clrconv);
+ return freerdp_color_convert_rgb_bgr(srcColor, srcBpp, dstBpp, clrconv);
}
uint8* freerdp_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)

0 comments on commit d588e30

Please sign in to comment.
Something went wrong with that request. Please try again.