"Changhui Liu" <liuchanghui(a)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.