Dear All, I'm sorry for my mistakes. I modified my patch, please review it again if you have time. Thanks a lot!
------------------ Original ------------------ From: "Sebastian Lackner"sebastian@fds-team.de; Date: Sat, Nov 22, 2014 00:19 AM To: "wine-devel"wine-devel@winehq.org; "liuchanghui"liuchanghui@linuxdeepin.com;
Subject: Re: gdiplus:GdipDrawImagePointsRect has a nosie vertical line outputafter resampled
Hi,
while looking quickly over your patch I noticed a couple of mistakes / things you should probably change:
On 21.11.2014 15:32, 刘昌辉 wrote:
- int src_img_height = src_rect.Height;
- int dest_img_width = dest_rect.X + dest_rect.Width;
- int dest_img_height = dest_rect.Height;
- BYTE* src_img_data = malloc (src_img_width*src_img_height*4);
- BYTE* dest_img_data = malloc (dest_img_width*dest_img_height*4);
You shouldn't use malloc(...) and free(...) in wine source, use HeapAlloc(...) and HeapFree(...) instead.
- /*first line*/
- value = *( (DWORD*)dest_img_data + dest_rect.X) ;
- /*printf ("pixel(%d,%d) = %08x\n", dest_rect.X, 0, value );*/
I assume the printf was for debugging, remove it, or if it is really very important then use trace(...) instead. Other tests use GdipBitmapGetPixel(...) for reading the color of specific pixels. If its possible to use that here too, it would look a bit better than directly accessing the memory.
- ok ( value > 0,
"dest image color should same as src image color\n");
You are switching between different styles in your patch several times. Try to make the style match a bit more the sourrounding code, especially whitespace before and after functions. In this case a linebreak is also not really necessary for example, other lines are much longer.
Regards, Sebastian