Huw Davies : winex11.drv: XRenderCompositeText has a problem with 0x0 glyphs, so we'll pretend they' re 1x1.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 7 07:20:16 CDT 2007


Module: wine
Branch: master
Commit: c9fd5a265f4b1f9a52ba27d8f30ddf855aeba55c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c9fd5a265f4b1f9a52ba27d8f30ddf855aeba55c

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Jun  6 15:20:16 2007 +0100

winex11.drv: XRenderCompositeText has a problem with 0x0 glyphs, so we'll pretend they're 1x1.

---

 dlls/winex11.drv/xrender.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index 612c048..74a7e2b 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -633,6 +633,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format)
     gsCacheEntryFormat *formatEntry;
     UINT ggo_format = GGO_GLYPH_INDEX;
     XRenderPictFormat pf;
+    const char zero = 0;
 
     switch(format) {
     case AA_Grey:
@@ -790,7 +791,6 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format)
 	}
     }
 
-    memcpy(&formatEntry->gis[glyph], &gi, sizeof(gi));
 
     if(formatEntry->glyphset) {
         if(format == AA_None && BitmapBitOrder(gdi_display) != MSBFirst) {
@@ -809,14 +809,28 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format)
 	    }
 	}
 	gid = glyph;
+
+        /*
+          XRenderCompositeText seems to ignore 0x0 glyphs when
+          AA_None, which means we lose the advance width of glyphs
+          like the space.  We'll pretend that such glyphs are 1x1
+          bitmaps.
+        */
+
+        if(buflen == 0)
+            gi.width = gi.height = 1;
+
         wine_tsx11_lock();
 	pXRenderAddGlyphs(gdi_display, formatEntry->glyphset, &gid, &gi, 1,
-			  buf, buflen);
+			  buflen ? buf : &zero, buflen ? buflen : 1);
 	wine_tsx11_unlock();
 	HeapFree(GetProcessHeap(), 0, buf);
     } else {
         formatEntry->bitmaps[glyph] = buf;
     }
+
+    memcpy(&formatEntry->gis[glyph], &gi, sizeof(gi));
+
     return TRUE;
 }
 




More information about the wine-cvs mailing list