From 0f834b91a4768673833ab4917e87d86c237bb1a6 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 23 Mar 2012 10:05:55 +0100 Subject: libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update 23 Mar 2012 --- xorg-server/render/mitrap.c | 58 +++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'xorg-server/render/mitrap.c') diff --git a/xorg-server/render/mitrap.c b/xorg-server/render/mitrap.c index 445f23630..17b6dcd1c 100644 --- a/xorg-server/render/mitrap.c +++ b/xorg-server/render/mitrap.c @@ -35,45 +35,47 @@ #include "mipict.h" static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) +miLineFixedX(xLineFixed * l, xFixed y, Bool ceil) { - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; + xFixed dx = l->p2.x - l->p1.x; + xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; + xFixed dy = l->p2.y - l->p1.y; + if (ceil) - ex += (dy - 1); + ex += (dy - 1); return l->p1.x + (xFixed) (ex / dy); } void -miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) +miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box) { box->y1 = MAXSHORT; box->y2 = MINSHORT; box->x1 = MAXSHORT; box->x2 = MINSHORT; - for (; ntrap; ntrap--, traps++) - { - INT16 x1, y1, x2, y2; + for (; ntrap; ntrap--, traps++) { + INT16 x1, y1, x2, y2; + + if (!xTrapezoidValid(traps)) + continue; + y1 = xFixedToInt(traps->top); + if (y1 < box->y1) + box->y1 = y1; + + y2 = xFixedToInt(xFixedCeil(traps->bottom)); + if (y2 > box->y2) + box->y2 = y2; + + x1 = xFixedToInt(min(miLineFixedX(&traps->left, traps->top, FALSE), + miLineFixedX(&traps->left, traps->bottom, FALSE))); + if (x1 < box->x1) + box->x1 = x1; - if (!xTrapezoidValid(traps)) - continue; - y1 = xFixedToInt (traps->top); - if (y1 < box->y1) - box->y1 = y1; - - y2 = xFixedToInt (xFixedCeil (traps->bottom)); - if (y2 > box->y2) - box->y2 = y2; - - x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE), - miLineFixedX (&traps->left, traps->bottom, FALSE))); - if (x1 < box->x1) - box->x1 = x1; - - x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE), - miLineFixedX (&traps->right, traps->bottom, TRUE)))); - if (x2 > box->x2) - box->x2 = x2; + x2 = xFixedToInt(xFixedCeil + (max + (miLineFixedX(&traps->right, traps->top, TRUE), + miLineFixedX(&traps->right, traps->bottom, TRUE)))); + if (x2 > box->x2) + box->x2 = x2; } } -- cgit v1.2.3