[1/2] gdiplus: Skip drawing lines of text with only empty glyphs.

Vincent Povirk madewokherd at gmail.com
Fri Sep 20 13:51:06 CDT 2013


This series should be independent of Akihiro Sagawa's patch series
that changes the behavior of GetGlyphOutline. It's related in that
that series made me aware that GGO returns 0 for empty glyphs, but if
I'm reading it correctly that was Wine's behavior all along. The
changes he is making shouldn't make gdiplus's current code behave any
worse than it already does, except in one way that he addressed in his
[4/8] patch to gdiplus (try 2, #98981), which I believe is both
correct and necessary, based on what he told me on wine-devel.
-------------- next part --------------
From 92cfecfbe190fa4377da5e735bbf088b167d4980 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Fri, 20 Sep 2013 13:12:45 -0500
Subject: [PATCH 1/2] gdiplus: Skip drawing lines of text with only empty
 glyphs.

---
 dlls/gdiplus/graphics.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 79e4c7c..1a07c03 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -6225,6 +6225,10 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI
         }
     }
 
+    if (max_glyphsize == 0)
+        /* Nothing to draw. */
+        return Ok;
+
     glyph_mask = GdipAlloc(max_glyphsize);
     text_mask = GdipAlloc((max_x - min_x) * (max_y - min_y));
     text_mask_stride = max_x - min_x;
-- 
1.8.1.2


More information about the wine-patches mailing list