Krzysztof Nowicki : windowscodecs: Optimise copy_pixels in case the whole bitmap is copied.
Module: wine Branch: master Commit: db6731f628c1be0e474860965d109954d8a9e71e URL: http://source.winehq.org/git/wine.git/?a=commit;h=db6731f628c1be0e474860965d... Author: Krzysztof Nowicki <krissn(a)op.pl> Date: Tue Oct 19 21:51:25 2010 +0200 windowscodecs: Optimise copy_pixels in case the whole bitmap is copied. --- dlls/windowscodecs/main.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 906ea16..6f37f5d 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -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)
participants (1)
-
Alexandre Julliard