[client,x11] fix /gdi:hw drawing.

This commit is contained in:
akallabeth 2023-02-14 08:41:42 +01:00 committed by Martin Fleisz
parent 34bc5e15f5
commit ff3c7c82ee
3 changed files with 10 additions and 51 deletions

View File

@ -411,9 +411,12 @@ static BOOL xf_end_paint(rdpContext* context)
if (gdi->suppressOutput)
return TRUE;
const BOOL sw = freerdp_settings_get_bool(context->settings, FreeRDP_SoftwareGdi);
HGDI_DC hdc = sw ? gdi->primary->hdc : xfc->hdc;
if (!xfc->complex_regions)
{
const GDI_RGN* rgn = gdi->primary->hdc->hwnd->invalid;
const GDI_RGN* rgn = hdc->hwnd->invalid;
if (rgn->null)
return TRUE;
xf_lock_x11(xfc);
@ -423,10 +426,10 @@ static BOOL xf_end_paint(rdpContext* context)
}
else
{
const INT32 ninvalid = gdi->primary->hdc->hwnd->ninvalid;
const GDI_RGN* cinvalid = gdi->primary->hdc->hwnd->cinvalid;
const INT32 ninvalid = hdc->hwnd->ninvalid;
const GDI_RGN* cinvalid = hdc->hwnd->cinvalid;
if (gdi->primary->hdc->hwnd->ninvalid < 1)
if (hdc->hwnd->ninvalid < 1)
return TRUE;
xf_lock_x11(xfc);
@ -442,8 +445,8 @@ static BOOL xf_end_paint(rdpContext* context)
xf_unlock_x11(xfc);
}
gdi->primary->hdc->hwnd->invalid->null = TRUE;
gdi->primary->hdc->hwnd->ninvalid = 0;
hdc->hwnd->invalid->null = TRUE;
hdc->hwnd->ninvalid = 0;
return TRUE;
}

View File

@ -925,20 +925,11 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context,
{
case SURFACECMD_FRAMEACTION_BEGIN:
xfc->frame_begin = TRUE;
xfc->frame_x1 = 0;
xfc->frame_y1 = 0;
xfc->frame_x2 = 0;
xfc->frame_y2 = 0;
break;
case SURFACECMD_FRAMEACTION_END:
xfc->frame_begin = FALSE;
if ((xfc->frame_x2 > xfc->frame_x1) && (xfc->frame_y2 > xfc->frame_y1))
ret = gdi_InvalidateRegion(xfc->hdc, xfc->frame_x1, xfc->frame_y1,
xfc->frame_x2 - xfc->frame_x1,
xfc->frame_y2 - xfc->frame_y1);
if (settings->FrameAcknowledge > 0)
{
WINPR_ASSERT(xfc->common.context.update);
@ -956,38 +947,7 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context,
static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, UINT16 width,
UINT16 height)
{
BOOL ret = TRUE;
if (!xfc->remote_app)
{
if (xfc->frame_begin)
{
if (xfc->frame_x2 > xfc->frame_x1 && xfc->frame_y2 > xfc->frame_y1)
{
xfc->frame_x1 = MIN(xfc->frame_x1, tx);
xfc->frame_y1 = MIN(xfc->frame_y1, ty);
xfc->frame_x2 = MAX(xfc->frame_x2, tx + width);
xfc->frame_y2 = MAX(xfc->frame_y2, ty + height);
}
else
{
xfc->frame_x1 = tx;
xfc->frame_y1 = ty;
xfc->frame_x2 = tx + width;
xfc->frame_y2 = ty + height;
}
}
else
{
ret = gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
}
}
else
{
ret = gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
}
return ret;
return gdi_InvalidateRegion(xfc->hdc, tx, ty, width, height);
}
static BOOL xf_gdi_update_screen(xfContext* xfc, BYTE* pSrcData, UINT32 scanline,

View File

@ -181,10 +181,6 @@ struct xf_context
BYTE* bitmap_buffer;
BOOL frame_begin;
UINT16 frame_x1;
UINT16 frame_y1;
UINT16 frame_x2;
UINT16 frame_y2;
int XInputOpcode;