[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 2/3] gdiplus: fix get_clip_hrgn when window origin point changed
From:       Dmitry Timoshkov <dmitry () baikal ! ru>
Date:       2014-12-23 5:50:19
Message-ID: 20141223135019.f973b43f.dmitry () baikal ! ru
[Download RAW message or body]

"Changhui Liu" <liuchanghui@linuxdeepin.com> wrote:

> --- a/dlls/gdiplus/graphics.c
> +++ b/dlls/gdiplus/graphics.c
> @@ -350,7 +350,18 @@ static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_
>  static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
>  {
>      /* clipping region is in device coords */
> -    return GdipGetRegionHRgn(graphics->clip, NULL, hrgn);
> +    GpStatus state = GdipGetRegionHRgn(graphics->clip, NULL, hrgn);

Please use 'status' instead of 'state'.

> +    if (graphics->hdc)
> +    {

This should be if (status == Ok && graphics->hdc)

> --- a/dlls/gdiplus/tests/graphics.c
> +++ b/dlls/gdiplus/tests/graphics.c
> @@ -5603,6 +5603,95 @@ static void test_GdipGetVisibleClipBounds_memoryDC(void)
>      ReleaseDC(hwnd, dc);
>  }
>  
> +#define BLUE_COLOR (0xff0000ff)
> +#define IsBlue(color) ( ((color) & 0x00ffffff) == 0xff )
> +#define GetBitmapPixel(x,y) pixel[(y)*(width) + (x)]

Inline helpers without Win32 API resembling names would be better. Something
like is_blue_color, get_bitmap_pixel. Same applies for remaining code.

-- 
Dmitry.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic