mirror of
https://github.com/reactos/wine.git
synced 2025-02-03 02:32:41 +00:00
windowscodecs: Optimise copy_pixels in case the whole bitmap is copied.
This commit is contained in:
parent
a1352035d1
commit
db6731f628
@ -77,6 +77,13 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
|
||||
if ((dststride * rc->Height) > dstbuffersize)
|
||||
return E_INVALIDARG;
|
||||
|
||||
/* if the whole bitmap is copied and the buffer format matches then it's a matter of a single memcpy */
|
||||
if (rc->X == 0 && rc->Y == 0 && rc->Width == srcwidth && rc->Height == srcheight && srcstride == dststride)
|
||||
{
|
||||
memcpy(dstbuffer, srcbuffer, srcstride * srcheight);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
row_offset = rc->X * bpp;
|
||||
|
||||
if (row_offset % 8 == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user