https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d2e1e843c831a5b3139f…
commit 8d2e1e843c831a5b3139f53201e644203c74bbcc
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Oct 1 12:50:25 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Oct 1 12:50:25 2018 +0100
[GDIPLUS] Sync with Wine Staging 3.17. CORE-15127
---
dll/win32/gdiplus/graphics.c | 34 +++++++++++++++++++++++++++-------
media/doc/README.WINE | 2 +-
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/dll/win32/gdiplus/graphics.c b/dll/win32/gdiplus/graphics.c
index 1e2aff14f4..5666346afc 100644
--- a/dll/win32/gdiplus/graphics.c
+++ b/dll/win32/gdiplus/graphics.c
@@ -1156,8 +1156,9 @@ static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
}
}
-static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
+static GpStatus brush_fill_path(GpGraphics *graphics, GpBrush *brush)
{
+ GpStatus status = Ok;
switch (brush->bt)
{
case BrushTypeSolidColor:
@@ -1170,12 +1171,22 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
RECT rc;
/* partially transparent fill */
- SelectClipPath(graphics->hdc, RGN_AND);
+ if (!SelectClipPath(graphics->hdc, RGN_AND))
+ {
+ status = GenericError;
+ DeleteObject(bmp);
+ break;
+ }
if (GetClipBox(graphics->hdc, &rc) != NULLREGION)
{
HDC hdc = CreateCompatibleDC(NULL);
- if (!hdc) break;
+ if (!hdc)
+ {
+ status = OutOfMemory;
+ DeleteObject(bmp);
+ break;
+ }
SelectObject(hdc, bmp);
gdi_alpha_blend(graphics, rc.left, rc.top, rc.right - rc.left, rc.bottom
- rc.top,
@@ -1193,7 +1204,11 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
HBRUSH gdibrush, old_brush;
gdibrush = create_gdi_brush(brush);
- if (!gdibrush) return;
+ if (!gdibrush)
+ {
+ status = OutOfMemory;
+ break;
+ }
old_brush = SelectObject(graphics->hdc, gdibrush);
FillPath(graphics->hdc);
@@ -1202,6 +1217,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
break;
}
}
+
+ return status;
}
static BOOL brush_can_fill_pixels(GpBrush *brush)
@@ -4337,7 +4354,7 @@ static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush
*brush, GpPath
if(retval == Ok)
{
EndPath(graphics->hdc);
- brush_fill_path(graphics, brush);
+ retval = brush_fill_path(graphics, brush);
}
gdi_transform_release(graphics);
@@ -4383,6 +4400,9 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush
*brush, GpPath *p
if(graphics->busy)
return ObjectBusy;
+ if (!path->pathdata.Count)
+ return Ok;
+
if (graphics->image && graphics->image->type == ImageTypeMetafile)
return METAFILE_FillPath((GpMetafile*)graphics->image, brush, path);
@@ -4643,13 +4663,13 @@ static GpStatus GDI32_GdipFillRegion(GpGraphics* graphics,
GpBrush* brush,
Rectangle(graphics->hdc, rc.left, rc.top, rc.right, rc.bottom);
EndPath(graphics->hdc);
- brush_fill_path(graphics, brush);
+ status = brush_fill_path(graphics, brush);
}
RestoreDC(graphics->hdc, save_state);
- return Ok;
+ return status;
}
static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush,
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index e218e01830..34f5a994cf 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -68,7 +68,7 @@ reactos/dll/win32/dciman32 # Synced to WineStaging-3.3
reactos/dll/win32/faultrep # Synced to WineStaging-2.9
reactos/dll/win32/fontsub # Synced to WineStaging-2.9
reactos/dll/win32/fusion # Synced to WineStaging-3.17
-reactos/dll/win32/gdiplus # Synced to WineStaging-3.9
+reactos/dll/win32/gdiplus # Synced to WineStaging-3.17
reactos/dll/win32/hhctrl.ocx # Synced to WineStaging-3.3
reactos/dll/win32/hlink # Synced to WineStaging-3.3
reactos/dll/win32/hnetcfg # Synced to WineStaging-3.9