Fixed various issues with primary orders.
This commit is contained in:
parent
83fba667c1
commit
f88ed950d3
@ -1096,9 +1096,9 @@ static BOOL xf_pre_connect(freerdp* instance)
|
|||||||
settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = FALSE;
|
settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = FALSE;
|
settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = FALSE;
|
settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = FALSE;
|
settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE;
|
settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
|
settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
|
||||||
@ -1108,9 +1108,9 @@ static BOOL xf_pre_connect(freerdp* instance)
|
|||||||
settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = settings->BitmapCacheEnabled;
|
settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = settings->BitmapCacheEnabled;
|
||||||
settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = settings->BitmapCacheEnabled;
|
settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = settings->BitmapCacheEnabled;
|
||||||
settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE;
|
settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
|
settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE;
|
settings->OrderSupport[NEG_FAST_INDEX_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE;
|
settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_POLYGON_SC_INDEX] = FALSE;
|
settings->OrderSupport[NEG_POLYGON_SC_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
|
settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
|
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
|
||||||
|
@ -212,7 +212,7 @@ struct _MULTI_DRAW_NINE_GRID_ORDER
|
|||||||
UINT32 bitmapId;
|
UINT32 bitmapId;
|
||||||
UINT32 nDeltaEntries;
|
UINT32 nDeltaEntries;
|
||||||
UINT32 cbData;
|
UINT32 cbData;
|
||||||
BYTE* codeDeltaList;
|
DELTA_RECT rectangles[45];
|
||||||
};
|
};
|
||||||
typedef struct _MULTI_DRAW_NINE_GRID_ORDER MULTI_DRAW_NINE_GRID_ORDER;
|
typedef struct _MULTI_DRAW_NINE_GRID_ORDER MULTI_DRAW_NINE_GRID_ORDER;
|
||||||
|
|
||||||
|
@ -265,15 +265,24 @@ static BOOL fastpath_recv_orders(rdpFastPath* fastpath, wStream* s)
|
|||||||
UINT16 numberOrders;
|
UINT16 numberOrders;
|
||||||
|
|
||||||
if (!fastpath || !fastpath->rdp || !s)
|
if (!fastpath || !fastpath->rdp || !s)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Invalid arguments");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
update = fastpath->rdp->update;
|
update = fastpath->rdp->update;
|
||||||
|
|
||||||
if (!update)
|
if (!update)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Invalid configuration");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (Stream_GetRemainingLength(s) < 2)
|
if (Stream_GetRemainingLength(s) < 2)
|
||||||
|
{
|
||||||
|
WLog_ERR(TAG, "Stream short");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
Stream_Read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */
|
Stream_Read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ static BOOL freerdp_check_point(rdpContext* context, INT32 x, INT32 y)
|
|||||||
if (x > dw)
|
if (x > dw)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (y > dw)
|
if (y > dh)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -328,6 +328,35 @@ fail:
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL adjust_point(rdpContext* context, INT32* px, INT32* py)
|
||||||
|
{
|
||||||
|
INT32 x, y;
|
||||||
|
UINT32 dw, dh;
|
||||||
|
|
||||||
|
if (!context || !context->settings || !px || !py)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
x = *px;
|
||||||
|
y = *py;
|
||||||
|
dw = context->settings->DesktopWidth;
|
||||||
|
dh = context->settings->DesktopHeight;
|
||||||
|
|
||||||
|
if (x < 0)
|
||||||
|
x = 0;
|
||||||
|
|
||||||
|
if (y < 0)
|
||||||
|
y = 0;
|
||||||
|
|
||||||
|
if (x > dw)
|
||||||
|
x = dw;
|
||||||
|
|
||||||
|
if (y > dh)
|
||||||
|
y = dh;
|
||||||
|
|
||||||
|
*px = x;
|
||||||
|
*py = y;
|
||||||
|
return TRUE;;
|
||||||
|
}
|
||||||
static BOOL freerdp_check_delta_point(rdpContext* context, INT32 x, INT32 y, UINT32 count,
|
static BOOL freerdp_check_delta_point(rdpContext* context, INT32 x, INT32 y, UINT32 count,
|
||||||
const DELTA_POINT* data)
|
const DELTA_POINT* data)
|
||||||
{
|
{
|
||||||
@ -1402,7 +1431,12 @@ static BOOL update_read_multi_draw_nine_grid_order(wStream* s,
|
|||||||
|
|
||||||
if (orderInfo->fieldFlags & ORDER_FIELD_07)
|
if (orderInfo->fieldFlags & ORDER_FIELD_07)
|
||||||
{
|
{
|
||||||
FIELD_SKIP_BUFFER16(s, multi_draw_nine_grid->cbData);
|
if (Stream_GetRemainingLength(s) < 2)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
Stream_Read_UINT16(s, multi_draw_nine_grid->cbData);
|
||||||
|
return update_read_delta_rects(s, multi_draw_nine_grid->rectangles,
|
||||||
|
multi_draw_nine_grid->nDeltaEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -3449,7 +3483,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
|
|||||||
primary->multi_draw_nine_grid.srcBottom))
|
primary->multi_draw_nine_grid.srcBottom))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// TODO: Delta rects
|
if (!freerdp_check_delta_rect(context, primary->multi_draw_nine_grid.nDeltaEntries,
|
||||||
|
primary->multi_draw_nine_grid.rectangles))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
rc = IFCALLRESULT(FALSE, primary->MultiDrawNineGrid, context, &primary->multi_draw_nine_grid);
|
rc = IFCALLRESULT(FALSE, primary->MultiDrawNineGrid, context, &primary->multi_draw_nine_grid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3462,10 +3499,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
|
|||||||
|
|
||||||
WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName);
|
WLog_Print(update->log, WLOG_DEBUG, "Primary Drawing Order %s", orderName);
|
||||||
|
|
||||||
if (!freerdp_check_point(context, primary->line_to.nXStart, primary->line_to.nYStart))
|
if (!adjust_point(context, &primary->line_to.nXStart, &primary->line_to.nYStart))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!freerdp_check_point(context, primary->line_to.nXEnd, primary->line_to.nYEnd))
|
if (!adjust_point(context, &primary->line_to.nXEnd, &primary->line_to.nYEnd))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rc = IFCALLRESULT(FALSE, primary->LineTo, context, &primary->line_to);
|
rc = IFCALLRESULT(FALSE, primary->LineTo, context, &primary->line_to);
|
||||||
@ -3604,7 +3641,7 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
|
|||||||
primary->fast_glyph.opRight, primary->fast_index.opBottom))
|
primary->fast_glyph.opRight, primary->fast_index.opBottom))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!freerdp_check_point(context, primary->fast_glyph.x, primary->fast_glyph.y))
|
if (!adjust_point(context, &primary->fast_glyph.x, &primary->fast_glyph.y))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rc = IFCALLRESULT(FALSE, primary->FastGlyph, context, &primary->fast_glyph);
|
rc = IFCALLRESULT(FALSE, primary->FastGlyph, context, &primary->fast_glyph);
|
||||||
|
@ -394,19 +394,19 @@ rdpSettings* freerdp_settings_new(DWORD flags)
|
|||||||
settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
|
settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE;
|
settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MEMBLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_MEM3BLT_INDEX] = TRUE;
|
settings->OrderSupport[NEG_MEM3BLT_INDEX] = TRUE;
|
||||||
settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = TRUE;
|
settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
|
settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE;
|
settings->OrderSupport[NEG_FAST_INDEX_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE;
|
settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_POLYGON_SC_INDEX] = TRUE;
|
settings->OrderSupport[NEG_POLYGON_SC_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_POLYGON_CB_INDEX] = TRUE;
|
settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = TRUE;
|
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
|
||||||
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = TRUE;
|
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
|
||||||
settings->ClientProductId = calloc(1, 32);
|
settings->ClientProductId = calloc(1, 32);
|
||||||
|
|
||||||
if (!settings->ClientProductId)
|
if (!settings->ClientProductId)
|
||||||
|
Loading…
Reference in New Issue
Block a user