From ce604a5a818a59b83cba0ec2c03c1cb14df7c7f1 Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Mon, 4 Nov 2024 17:51:57 +0800 Subject: [PATCH] [core,primitive] fix rgb primitive copy without conversion. --- libfreerdp/primitives/prim_copy.c | 17 +++++++++++++++++ libfreerdp/primitives/sse/prim_copy_avx2.c | 13 +++++++++++++ libfreerdp/primitives/sse/prim_copy_sse4_1.c | 13 +++++++++++++ 3 files changed, 43 insertions(+) diff --git a/libfreerdp/primitives/prim_copy.c b/libfreerdp/primitives/prim_copy.c index a76bc52d3..39a66a2a7 100644 --- a/libfreerdp/primitives/prim_copy.c +++ b/libfreerdp/primitives/prim_copy.c @@ -309,6 +309,23 @@ static INLINE pstatus_t generic_image_copy_no_overlap_dst_alpha( break; } break; + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + switch (DstFormat) + { + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + return generic_image_copy_bgrx32_bgrx32( + pDstData, nDstStep, nXDst, nYDst, nWidth, nHeight, pSrcData, nSrcStep, + nXSrc, nYSrc, srcVMultiplier, srcVOffset, dstVMultiplier, dstVOffset); + case PIXEL_FORMAT_RGB24: + return generic_image_copy_bgr24_bgrx32( + pDstData, nDstStep, nXDst, nYDst, nWidth, nHeight, pSrcData, nSrcStep, + nXSrc, nYSrc, srcVMultiplier, srcVOffset, dstVMultiplier, dstVOffset); + default: + break; + } + break; default: break; } diff --git a/libfreerdp/primitives/sse/prim_copy_avx2.c b/libfreerdp/primitives/sse/prim_copy_avx2.c index 57af2d30c..e5707116e 100644 --- a/libfreerdp/primitives/sse/prim_copy_avx2.c +++ b/libfreerdp/primitives/sse/prim_copy_avx2.c @@ -196,6 +196,19 @@ static pstatus_t avx2_image_copy_no_overlap_dst_alpha( break; } break; + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + switch (DstFormat) + { + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + return avx2_image_copy_bgrx32_bgrx32( + pDstData, nDstStep, nXDst, nYDst, nWidth, nHeight, pSrcData, nSrcStep, + nXSrc, nYSrc, srcVMultiplier, srcVOffset, dstVMultiplier, dstVOffset); + default: + break; + } + break; default: break; } diff --git a/libfreerdp/primitives/sse/prim_copy_sse4_1.c b/libfreerdp/primitives/sse/prim_copy_sse4_1.c index 108123d2b..1458118ae 100644 --- a/libfreerdp/primitives/sse/prim_copy_sse4_1.c +++ b/libfreerdp/primitives/sse/prim_copy_sse4_1.c @@ -180,6 +180,19 @@ static pstatus_t sse_image_copy_no_overlap_dst_alpha( break; } break; + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + switch (DstFormat) + { + case PIXEL_FORMAT_RGBX32: + case PIXEL_FORMAT_RGBA32: + return sse_image_copy_bgrx32_bgrx32( + pDstData, nDstStep, nXDst, nYDst, nWidth, nHeight, pSrcData, nSrcStep, + nXSrc, nYSrc, srcVMultiplier, srcVOffset, dstVMultiplier, dstVOffset); + default: + break; + } + break; default: break; }