mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[primitives,copy] revert single memcpy
copying the while image messes up as the src and destination strides not
necessarily align. (reverts 1a58e74c17
)
This commit is contained in:
parent
81203e7e83
commit
c87b2cc93d
@ -236,21 +236,12 @@ pstatus_t generic_image_copy_no_overlap_memcpy(
|
|||||||
SSIZE_T srcVMultiplier, SSIZE_T srcVOffset, SSIZE_T dstVMultiplier, SSIZE_T dstVOffset,
|
SSIZE_T srcVMultiplier, SSIZE_T srcVOffset, SSIZE_T dstVMultiplier, SSIZE_T dstVOffset,
|
||||||
UINT32 flags)
|
UINT32 flags)
|
||||||
{
|
{
|
||||||
const BOOL vSrcVFlip = (flags & FREERDP_FLIP_VERTICAL) ? TRUE : FALSE;
|
|
||||||
const SSIZE_T dstByte = FreeRDPGetBytesPerPixel(DstFormat);
|
const SSIZE_T dstByte = FreeRDPGetBytesPerPixel(DstFormat);
|
||||||
const SSIZE_T srcByte = FreeRDPGetBytesPerPixel(SrcFormat);
|
const SSIZE_T srcByte = FreeRDPGetBytesPerPixel(SrcFormat);
|
||||||
const SSIZE_T copyDstWidth = nWidth * dstByte;
|
const SSIZE_T copyDstWidth = nWidth * dstByte;
|
||||||
const SSIZE_T xSrcOffset = nXSrc * srcByte;
|
const SSIZE_T xSrcOffset = nXSrc * srcByte;
|
||||||
const SSIZE_T xDstOffset = nXDst * dstByte;
|
const SSIZE_T xDstOffset = nXDst * dstByte;
|
||||||
|
|
||||||
if (!vSrcVFlip && (nDstStep == nSrcStep) && (xSrcOffset == 0) && (xDstOffset == 0))
|
|
||||||
{
|
|
||||||
const void* src = &pSrcData[1ull * nYSrc * nSrcStep];
|
|
||||||
void* dst = &pDstData[1ull * nYDst * nDstStep];
|
|
||||||
memcpy(dst, src, 1ull * nDstStep * nHeight);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (SSIZE_T y = 0; y < nHeight; y++)
|
for (SSIZE_T y = 0; y < nHeight; y++)
|
||||||
{
|
{
|
||||||
const BYTE* WINPR_RESTRICT srcLine =
|
const BYTE* WINPR_RESTRICT srcLine =
|
||||||
@ -259,7 +250,6 @@ pstatus_t generic_image_copy_no_overlap_memcpy(
|
|||||||
&pDstData[dstVMultiplier * (y + nYDst) * nDstStep + dstVOffset];
|
&pDstData[dstVMultiplier * (y + nYDst) * nDstStep + dstVOffset];
|
||||||
memcpy(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth);
|
memcpy(&dstLine[xDstOffset], &srcLine[xSrcOffset], copyDstWidth);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return PRIMITIVES_SUCCESS;
|
return PRIMITIVES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user