Merge pull request #481 from meosborne/d588e30a3873073e4ab76078ea27a61ada9922dd

Correct inaccurate colors on 16-bit X displays when using hardware gdi.
This commit is contained in:
Marc-André Moreau 2012-03-03 11:09:55 -08:00
commit eb0e0f12a6
3 changed files with 10 additions and 10 deletions

View File

@ -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 File

@ -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 File

@ -339,7 +339,7 @@ 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)
@ -347,7 +347,7 @@ uint32 freerdp_color_convert_var_bgr(uint32 srcColor, int srcBpp, int dstBpp, HC
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)