Abort glyph rendering if everything is clipped

Alexandre Julliard julliard at winehq.org
Sat Oct 11 19:50:17 CDT 2003


Warren_Baird at cimmetry.com writes:

>     if(flags & (ETO_CLIPPED | ETO_OPAQUE)) {
>         if(!lprect) {
>          if(flags & ETO_CLIPPED) {
>           if(glyphs != wstr) HeapFree(GetProcessHeap(), 0, glyphs);
>           return FALSE;
>          }
>          GetTextExtentPointI(hdc, glyphs, count, &sz);
>          done_extents = TRUE;
>          rc.left = x;
>          rc.top = y;
>          rc.right = x + sz.cx;
>          rc.bottom = y + sz.cy;
>      } else {
>          if (IsRectEmpty(lprect)) {
>           if(glyphs != wstr) HeapFree(GetProcessHeap(), 0, glyphs);
>           return TRUE;
>          }
>          rc = *lprect;
>      }
>
>      LPtoDP(physDev->hdc, (POINT*)&rc, 2);
>
>      if(rc.left > rc.right) {INT tmp = rc.left; rc.left = rc.right; rc.right =
> tmp;}
>      if(rc.top > rc.bottom) {INT tmp = rc.top; rc.top = rc.bottom; rc.bottom =
> tmp;}
>     }
>
> If this looks good, I can submit a new patch this afternoon...

That looks better yes; it's still a bit complex IMO, but I'm not sure
it's possible to do much better with that glyph index thing. Still I'm
wondering if you shouldn't do the IsRectEmpty check after the LPtoDP
and coordinates swap.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list