Huw Davies : winex11.drv: Fix rendering of fonts that don' t support anti-aliasing.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 21 05:59:01 CDT 2006


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Aug 21 10:50:59 2006 +0100

winex11.drv: Fix rendering of fonts that don't support anti-aliasing.

---

 dlls/winex11.drv/xrender.c |   62 +++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c
index de12029..1f40b9b 100644
--- a/dlls/winex11.drv/xrender.c
+++ b/dlls/winex11.drv/xrender.c
@@ -632,6 +632,36 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *
     UINT ggo_format = GGO_GLYPH_INDEX;
     XRenderPictFormat pf;
 
+    switch(format) {
+    case AA_Grey:
+	ggo_format |= WINE_GGO_GRAY16_BITMAP;
+	break;
+
+    default:
+        ERR("aa = %d - not implemented\n", format);
+    case AA_None:
+        ggo_format |= GGO_BITMAP;
+	break;
+    }
+
+    buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
+			      NULL);
+    if(buflen == GDI_ERROR) {
+        if(format != AA_None) {
+            format = AA_None;
+            entry->aa_default = AA_None;
+            ggo_format &= ~WINE_GGO_GRAY16_BITMAP;
+            ggo_format |= GGO_BITMAP;
+            buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
+                                      NULL);
+        }
+        if(buflen == GDI_ERROR) {
+            ERR("GetGlyphOutlineW failed\n");
+            return FALSE;
+        }
+        TRACE("Turning off antialiasing for this monochrome font\n");
+    }
+
     /* If there is nothing for the current type, we create the entry. */
     if( !entry->format[format] ) {
         entry->format[format] = HeapAlloc(GetProcessHeap(),
@@ -676,35 +706,6 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *
 	}
     }
 
-    switch(format) {
-    case AA_Grey:
-	ggo_format |= WINE_GGO_GRAY16_BITMAP;
-	break;
-
-    default:
-        ERR("aa = %d - not implemented\n", format);
-    case AA_None:
-        ggo_format |= GGO_BITMAP;
-	break;
-    }
-
-    buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
-			      NULL);
-    if(buflen == GDI_ERROR) {
-        if(format != AA_None) {
-            format = AA_None;
-            entry->aa_default = AA_None;
-            ggo_format &= ~WINE_GGO_GRAY16_BITMAP;
-            ggo_format |= GGO_BITMAP;
-            buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL,
-                                      NULL);
-        }
-        if(buflen == GDI_ERROR) {
-            ERR("GetGlyphOutlineW failed\n");
-            return FALSE;
-        }
-        TRACE("Turning off antialiasing for this monochrome font\n");
-    }
 
     if(formatEntry->glyphset == 0 && X11DRV_XRender_Installed) {
         switch(format) {
@@ -1250,6 +1251,9 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_P
     for(idx = 0; idx < count; idx++) {
         if( !formatEntry ) {
 	    UploadGlyph(physDev, wstr[idx], antialias);
+            /* re-evaluate antialias since aa_default may have changed */
+            if( disable_antialias == FALSE )
+                antialias = entry->aa_default;
             formatEntry = entry->format[antialias];
         } else if( wstr[idx] >= formatEntry->nrealized || formatEntry->realized[wstr[idx]] == FALSE) {
 	    UploadGlyph(physDev, wstr[idx], antialias);




More information about the wine-cvs mailing list