[PATCH 1/4] gdiplus: Remove outdated FIXME comment about compositing mode.
Removes an outdated comment about graphics compositing mode being unused. Graphics compositing mode has been used in pixel blending since a16a4d97. Signed-off-by: Shawn M. Chapla <schapla(a)codeweavers.com> --- dlls/gdiplus/graphics.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index f0da41c6cbb..57022003249 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4781,7 +4781,6 @@ GpStatus WINGDIPAPI GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect) return GdipGetRegionBoundsI(graphics->clip, graphics, rect); } -/* FIXME: Compositing mode is not used anywhere except the getter/setter. */ GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *mode) { -- 2.28.0
Signed-off-by: Shawn M. Chapla <schapla(a)codeweavers.com> --- dlls/gdiplus/graphics.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 57022003249..c3542b3d65d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5192,7 +5192,14 @@ GpStatus gdip_format_string(HDC hdc, } if (hotkeyprefix_count) + { hotkeyprefix_offsets = heap_alloc_zero(sizeof(INT) * hotkeyprefix_count); + if (!hotkeyprefix_offsets) + { + heap_free(stringdup); + return OutOfMemory; + } + } hotkeyprefix_count = 0; @@ -6555,6 +6562,7 @@ GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST G if(count<=0) return InvalidParameter; ptf = heap_alloc_zero(sizeof(GpPointF) * count); + if (!ptf) return OutOfMemory; for(i = 0;i < count; i++){ ptf[i].X = (REAL)points[i].X; -- 2.28.0
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
Signed-off-by: Shawn M. Chapla <schapla(a)codeweavers.com> --- dlls/gdiplus/tests/graphics.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index d1f0d03ddcc..38780d46865 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -5071,6 +5071,7 @@ static void test_clipping(void) GpRegion *region, *region100x100; GpMatrix *matrix; GpRectF rect; + GpRect recti; GpPointF ptf[4]; GpUnit unit; HRGN hrgn; @@ -5107,6 +5108,11 @@ static void test_clipping(void) ok(rect.X == 100.0 && rect.Y == 100.0 && rect.Width == 100.0 && rect.Height == 100.0, "expected 100.0,100.0-100.0,100.0, got %.2f,%.2f-%.2f,%.2f\n", rect.X, rect.Y, rect.Width, rect.Height); + status = GdipGetClipBoundsI(graphics, &recti); + expect(Ok, status); + ok(recti.X == 100 && recti.Y == 100 && recti.Width == 100 && recti.Height == 100, + "expected 100,100-100,100, got %i,%i-%i,%i\n", recti.X, recti.Y, recti.Width, recti.Height); + /* Clip region does not account for changes to gdi32 transform */ SetViewportOrgEx(hdc, 10, 10, NULL); @@ -5149,6 +5155,11 @@ static void test_clipping(void) ok(rect.X == 45.0 && rect.Y == 20.0 && rect.Width == 50.0 && rect.Height == 25.0, "expected 45.0,20.0-50.0,25.0, got %.2f,%.2f-%.2f,%.2f\n", rect.X, rect.Y, rect.Width, rect.Height); + status = GdipGetClipBoundsI(graphics, &recti); + expect(Ok, status); + todo_wine ok(recti.X == 45 && recti.Y == 20 && recti.Width == 50 && recti.Height == 25, + "expected 45,20-50,25, got %i,%i-%i,%i\n", recti.X, recti.Y, recti.Width, recti.Height); + status = GdipSetEmpty(region); expect(Ok, status); status = GdipGetClip(graphics, region); -- 2.28.0
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
Signed-off-by: Shawn M. Chapla <schapla(a)codeweavers.com> --- dlls/gdiplus/graphics.c | 16 ++++++++++++---- dlls/gdiplus/tests/graphics.c | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c3542b3d65d..5db8973c7b6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4770,15 +4770,23 @@ GpStatus WINGDIPAPI GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect) */ GpStatus WINGDIPAPI GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect) { + GpRectF rectf; + GpStatus stat; + TRACE("(%p, %p)\n", graphics, rect); - if(!graphics) + if (!rect) return InvalidParameter; - if(graphics->busy) - return ObjectBusy; + if ((stat = GdipGetClipBounds(graphics, &rectf)) == Ok) + { + rect->X = gdip_round(rectf.X); + rect->Y = gdip_round(rectf.Y); + rect->Width = gdip_round(rectf.Width); + rect->Height = gdip_round(rectf.Height); + } - return GdipGetRegionBoundsI(graphics->clip, graphics, rect); + return stat; } GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics, diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 38780d46865..1dbb0ae279f 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -5157,7 +5157,7 @@ static void test_clipping(void) status = GdipGetClipBoundsI(graphics, &recti); expect(Ok, status); - todo_wine ok(recti.X == 45 && recti.Y == 20 && recti.Width == 50 && recti.Height == 25, + ok(recti.X == 45 && recti.Y == 20 && recti.Width == 50 && recti.Height == 25, "expected 45,20-50,25, got %i,%i-%i,%i\n", recti.X, recti.Y, recti.Width, recti.Height); status = GdipSetEmpty(region); -- 2.28.0
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
participants (2)
-
Esme Povirk (they/them) -
Shawn M. Chapla