Merge pull request #3637 from mfleisz/rfx_api_simplify

codec: Remove src format parameter from rfx_process_message
This commit is contained in:
akallabeth 2016-12-02 09:38:33 +01:00 committed by GitHub
commit ac9e7530d3
5 changed files with 7 additions and 15 deletions

View File

@ -1018,11 +1018,8 @@ static BOOL xf_gdi_surface_bits(rdpContext* context,
switch (cmd->codecID) switch (cmd->codecID)
{ {
case RDP_CODEC_ID_REMOTEFX: case RDP_CODEC_ID_REMOTEFX:
format = PIXEL_FORMAT_BGRX32;
if (!rfx_process_message(context->codecs->rfx, cmd->bitmapData, if (!rfx_process_message(context->codecs->rfx, cmd->bitmapData,
format, cmd->bitmapDataLength, cmd->bitmapDataLength, 0, 0,
0, 0,
gdi->primary_buffer, gdi->dstFormat, stride, gdi->primary_buffer, gdi->dstFormat, stride,
gdi->height, NULL)) gdi->height, NULL))
goto fail; goto fail;

View File

@ -171,8 +171,7 @@ struct _RFX_CONTEXT
FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context, FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context,
UINT32 pixel_format); UINT32 pixel_format);
FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, FREERDP_API BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
UINT32 format, UINT32 length,
UINT32 left, UINT32 top, UINT32 left, UINT32 top,
BYTE* dst, UINT32 dstFormat, BYTE* dst, UINT32 dstFormat,
UINT32 dstStride, UINT32 dstHeight, UINT32 dstStride, UINT32 dstHeight,

View File

@ -996,8 +996,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context,
return rc; return rc;
} }
BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length,
UINT32 format, UINT32 length,
UINT32 left, UINT32 top, UINT32 left, UINT32 top,
BYTE* dst, UINT32 dstFormat, BYTE* dst, UINT32 dstFormat,
UINT32 dstStride, UINT32 dstHeight, UINT32 dstStride, UINT32 dstHeight,
@ -1153,7 +1152,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data,
UINT32 nbUpdateRects; UINT32 nbUpdateRects;
REGION16 clippingRects; REGION16 clippingRects;
const RECTANGLE_16* updateRects; const RECTANGLE_16* updateRects;
const DWORD formatSize = GetBytesPerPixel(format); const DWORD formatSize = GetBytesPerPixel(context->pixel_format);
region16_init(&clippingRects); region16_init(&clippingRects);
for (i = 0; i < message->numRects; i++) for (i = 0; i < message->numRects; i++)
@ -1191,7 +1190,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data,
if (!freerdp_image_copy(dst, dstFormat, dstStride, if (!freerdp_image_copy(dst, dstFormat, dstStride,
nXDst, nYDst, nWidth, nHeight, nXDst, nYDst, nWidth, nHeight,
tile->data, format, stride, nXSrc, nYSrc, NULL, FREERDP_FLIP_NONE)) tile->data, context->pixel_format, stride, nXSrc, nYSrc, NULL, FREERDP_FLIP_NONE))
goto fail; goto fail;
if (invalidRegion) if (invalidRegion)

View File

@ -960,10 +960,7 @@ static BOOL gdi_surface_bits(rdpContext* context,
switch (cmd->codecID) switch (cmd->codecID)
{ {
case RDP_CODEC_ID_REMOTEFX: case RDP_CODEC_ID_REMOTEFX:
format = PIXEL_FORMAT_BGRX32;
if (!rfx_process_message(context->codecs->rfx, cmd->bitmapData, if (!rfx_process_message(context->codecs->rfx, cmd->bitmapData,
format,
cmd->bitmapDataLength, cmd->bitmapDataLength,
cmd->destLeft, cmd->destTop, cmd->destLeft, cmd->destTop,
gdi->primary_buffer, gdi->dstFormat, gdi->primary_buffer, gdi->dstFormat,

View File

@ -257,8 +257,8 @@ static UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi,
if (!surface) if (!surface)
return ERROR_INTERNAL_ERROR; return ERROR_INTERNAL_ERROR;
if (!rfx_process_message(surface->codecs->rfx, cmd->data, cmd->format, rfx_context_set_pixel_format(surface->codecs->rfx, cmd->format);
cmd->length, if (!rfx_process_message(surface->codecs->rfx, cmd->data, cmd->length,
cmd->left, cmd->top, cmd->left, cmd->top,
surface->data, surface->format, surface->scanline, surface->data, surface->format, surface->scanline,
surface->height, &surface->invalidRegion)) surface->height, &surface->invalidRegion))