Alexandre Julliard : winex11: Fix handling of the lpDx array in ExtTextOut for the non-Xrender case.

Alexandre Julliard julliard at winehq.org
Thu Jul 29 12:08:38 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jul 28 23:10:49 2010 +0200

winex11: Fix handling of the lpDx array in ExtTextOut for the non-Xrender case.

---

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

diff --git a/dlls/winex11.drv/text.c b/dlls/winex11.drv/text.c
index 7773588..1431bc1 100644
--- a/dlls/winex11.drv/text.c
+++ b/dlls/winex11.drv/text.c
@@ -62,14 +62,10 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
     if (pfo->lf.lfEscapement && pfo->lpX11Trans)
         rotated = TRUE;
 
-    TRACE("hdc=%p df=%04x %d,%d %s, %d  flags=%d lpDx=%p\n",
-	  physDev->hdc, (UINT16)(physDev->font), x, y,
+    TRACE("hdc=%p df=%04x %d,%d rc %s %s, %d  flags=%d lpDx=%p\n",
+          physDev->hdc, (UINT16)physDev->font, x, y, wine_dbgstr_rect(lprect),
 	  debugstr_wn (wstr, count), count, flags, lpDx);
 
-    if (lprect != NULL) TRACE("\trect=(%d,%d - %d,%d)\n",
-                                     lprect->left, lprect->top,
-                                     lprect->right, lprect->bottom );
-
       /* Draw the rectangle */
 
     if (flags & ETO_OPAQUE)
@@ -126,24 +122,26 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
         }
         else
         {
-            XTextItem16 *items, *pitem;
+            XTextItem16 *items;
 
-            pitem = items = HeapAlloc( GetProcessHeap(), 0,
-                                       count * sizeof(XTextItem16) );
+            items = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XTextItem16) );
             if(items == NULL) goto FAIL;
 
-            for(i = 0; i < count; i++)
+            items[0].chars = str2b;
+            items[0].delta = 0;
+            items[0].nchars = 1;
+            items[0].font = None;
+            for(i = 1; i < count; i++)
             {
-                pitem->chars  = str2b + i;
-                pitem->delta  = lpDx[i];
-                pitem->nchars = 1;
-                pitem->font   = None;
-                pitem++;
+                items[i].chars  = str2b + i;
+                items[i].delta  = (flags & ETO_PDY) ? lpDx[(i - 1) * 2] : lpDx[i - 1];
+                items[i].delta -= X11DRV_cptable[pfo->fi->cptable].pTextWidth( pfo, str2b + i - 1, 1 );
+                items[i].nchars = 1;
+                items[i].font   = None;
             }
-
             X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, gdi_display,
                                   physDev->drawable, physDev->gc,
-                                  physDev->dc_rect.left + x, physDev->dc_rect.top + y, items, pitem - items );
+                                  physDev->dc_rect.left + x, physDev->dc_rect.top + y, items, count );
             HeapFree( GetProcessHeap(), 0, items );
         }
     }
@@ -167,7 +165,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
                                     x_i, y_i, &str2b[i], 1);
             if (lpDx)
             {
-                offset += lpDx[i];
+                offset += (flags & ETO_PDY) ? lpDx[i * 2] : lpDx[i];
             }
             else
             {




More information about the wine-cvs mailing list