Module: wine Branch: master Commit: 4b525aa0a4eb8bd60e0f9a2f9eb5f4598aa87a4e URL: https://source.winehq.org/git/wine.git/?a=commit;h=4b525aa0a4eb8bd60e0f9a2f9...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Fri Aug 24 16:04:02 2018 +0800
oleaut32/tests: Fix the IPicture::Render() usage.
When one specifies the target rectangle (0, 0, width, -height) IPicture::Render() places the origin at 0,0 and flips the image vertically. This means that in order to paint an icon on the DC it's necessary to specify the rectangle (0, height, width, -height), i.e. place the origin at 0,height. I've written a test app that verifies this behaviour, ufortunately I don't see a way to add a Wine test case for this.
The test currently works by chance under Windows because in case of (0, 0, width, -height) IPicture::Render() draws black rectangle instead of an icon at (0, 0, width, height). If Wine intends to replicate this behaviour it should be fixed by a separate patch.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/oleaut32/tests/olepicture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index c06cec1..6a5f7ee 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -864,7 +864,7 @@ static void test_Render(void) SetPixelV(hdc, 10, 10, 0x00223344); expected = GetPixel(hdc, 0, 0);
- hres = picture_render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL); + hres = picture_render(pic, hdc, 1, 1, 9, 9, 0, pHeight, pWidth, -pHeight, NULL); ole_expect(hres, S_OK);
if(hres != S_OK) goto done;