Huw Davies : user32: Merge the blitting of the centred and non-centred cases.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Oct 29 07:36:58 CDT 2014
Module: wine
Branch: master
Commit: 3cd145f63f0ba15726b32c6be800460e3aef84e4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3cd145f63f0ba15726b32c6be800460e3aef84e4
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Oct 29 09:09:08 2014 +0000
user32: Merge the blitting of the centred and non-centred cases.
---
dlls/user32/static.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/static.c b/dlls/user32/static.c
index f4b5880..ff5c77c 100644
--- a/dlls/user32/static.c
+++ b/dlls/user32/static.c
@@ -775,19 +775,15 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
GetClientRect(hwnd, &rcClient);
if (style & SS_CENTERIMAGE)
{
- INT x, y;
- x = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
- y = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
FillRect( hdc, &rcClient, hbrush );
- BitBlt(hdc, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
- SRCCOPY);
- }
- else
- {
- StretchBlt(hdc, 0, 0, rcClient.right - rcClient.left,
- rcClient.bottom - rcClient.top, hMemDC,
- 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
+ rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
+ rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
+ rcClient.right = rcClient.left + bm.bmWidth;
+ rcClient.bottom = rcClient.top + bm.bmHeight;
}
+ StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
+ rcClient.bottom - rcClient.top, hMemDC,
+ 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
SelectObject(hMemDC, oldbitmap);
DeleteDC(hMemDC);
}
More information about the wine-cvs
mailing list