Merge pull request #4256 from akallabeth/15bpp_fix
Fix #4111: 15bpp color handling for brush.
This commit is contained in:
commit
ca4d204c78
@ -369,7 +369,12 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
case GDI_BS_PATTERN:
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
Pixmap pattern = xf_brush_new(xfc, 8, 8, brush->bpp, brush->data);
|
||||
UINT32 bpp = brush->bpp;
|
||||
|
||||
if ((bpp == 16) && (context->settings->ColorDepth == 15))
|
||||
bpp = 15;
|
||||
|
||||
Pixmap pattern = xf_brush_new(xfc, 8, 8, bpp, brush->data);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillTiled);
|
||||
XSetTile(xfc->display, xfc->gc, pattern);
|
||||
XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y);
|
||||
@ -681,7 +686,12 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||
case GDI_BS_PATTERN:
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
pattern = xf_brush_new(xfc, 8, 8, brush->bpp, brush->data);
|
||||
UINT32 bpp = brush->bpp;
|
||||
|
||||
if ((bpp == 16) && (context->settings->ColorDepth == 15))
|
||||
bpp = 15;
|
||||
|
||||
pattern = xf_brush_new(xfc, 8, 8, bpp, brush->data);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillTiled);
|
||||
XSetTile(xfc->display, xfc->gc, pattern);
|
||||
XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y);
|
||||
@ -854,7 +864,12 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context,
|
||||
{
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
pattern = xf_brush_new(xfc, 8, 8, brush->bpp, brush->data);
|
||||
UINT32 bpp = brush->bpp;
|
||||
|
||||
if ((bpp == 16) && (context->settings->ColorDepth == 15))
|
||||
bpp = 15;
|
||||
|
||||
pattern = xf_brush_new(xfc, 8, 8, bpp, brush->data);
|
||||
XSetFillStyle(xfc->display, xfc->gc, FillTiled);
|
||||
XSetTile(xfc->display, xfc->gc, pattern);
|
||||
}
|
||||
@ -996,15 +1011,14 @@ static BOOL xf_gdi_update_screen(xfContext* xfc, const BYTE* pSrcData,
|
||||
UINT32 width = rects[i].right - rects[i].left;
|
||||
UINT32 height = rects[i].bottom - rects[i].top;
|
||||
const BYTE* src = pSrcData + top * scanline + 4 * left;
|
||||
|
||||
image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0,
|
||||
(char*) src, width, height, xfc->scanline_pad, scanline);
|
||||
|
||||
if (!image)
|
||||
break;
|
||||
|
||||
image->byte_order = LSBFirst;
|
||||
image->bitmap_bit_order = LSBFirst;
|
||||
|
||||
XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0, left, top, width, height);
|
||||
XFree(image);
|
||||
ret = xf_gdi_surface_update_frame(xfc, left, top, width, height);
|
||||
@ -1033,10 +1047,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context,
|
||||
cmdRect.top = cmd->destTop;
|
||||
cmdRect.right = cmdRect.left + cmd->width;
|
||||
cmdRect.bottom = cmdRect.top + cmd->height;
|
||||
|
||||
|
||||
gdi = context->gdi;
|
||||
|
||||
xf_lock_x11(xfc, FALSE);
|
||||
|
||||
switch (cmd->codecID)
|
||||
|
@ -603,7 +603,12 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
brushFormat = gdi_get_pixel_format(brush->bpp);
|
||||
UINT32 bpp = brush->bpp;
|
||||
|
||||
if ((bpp == 16) && (context->settings->ColorDepth == 15))
|
||||
bpp = 15;
|
||||
|
||||
brushFormat = gdi_get_pixel_format(bpp);
|
||||
|
||||
if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0,
|
||||
8, 8, brush->data, brushFormat, 0, 0, 0,
|
||||
@ -848,7 +853,12 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||
|
||||
if (brush->bpp > 1)
|
||||
{
|
||||
brushFormat = gdi_get_pixel_format(brush->bpp);
|
||||
UINT32 bpp = brush->bpp;
|
||||
|
||||
if ((bpp == 16) && (context->settings->ColorDepth == 15))
|
||||
bpp = 15;
|
||||
|
||||
brushFormat = gdi_get_pixel_format(bpp);
|
||||
|
||||
if (!freerdp_image_copy(data, gdi->drawing->hdc->format, 0, 0, 0,
|
||||
8, 8, brush->data, brushFormat,
|
||||
@ -989,14 +999,12 @@ static BOOL gdi_surface_bits(rdpContext* context,
|
||||
"bpp %"PRIu32" codecID %"PRIu32" width %"PRIu32" height %"PRIu32" length %"PRIu32"",
|
||||
cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
|
||||
cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
|
||||
|
||||
region16_init(®ion);
|
||||
cmdRect.left = cmd->destLeft;
|
||||
cmdRect.top = cmd->destTop;
|
||||
cmdRect.right = cmdRect.left + cmd->width;
|
||||
cmdRect.bottom = cmdRect.top + cmd->height;
|
||||
|
||||
|
||||
switch (cmd->codecID)
|
||||
{
|
||||
case RDP_CODEC_ID_REMOTEFX:
|
||||
@ -1009,6 +1017,7 @@ static BOOL gdi_surface_bits(rdpContext* context,
|
||||
WLog_ERR(TAG, "Failed to process RemoteFX message");
|
||||
goto out;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RDP_CODEC_ID_NSCODEC:
|
||||
@ -1023,6 +1032,7 @@ static BOOL gdi_surface_bits(rdpContext* context,
|
||||
WLog_ERR(TAG, "Failed to process NSCodec message");
|
||||
goto out;
|
||||
}
|
||||
|
||||
region16_union_rect(®ion, ®ion, &cmdRect);
|
||||
break;
|
||||
|
||||
@ -1037,6 +1047,7 @@ static BOOL gdi_surface_bits(rdpContext* context,
|
||||
WLog_ERR(TAG, "Failed to process nocodec message");
|
||||
goto out;
|
||||
}
|
||||
|
||||
region16_union_rect(®ion, ®ion, &cmdRect);
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user