922f22a6ae47db19293d4f59858f20a9f098cc92
3 * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
5 * Permission to use, copy, modify, distribute, and sell this software and its
6 * documentation for any purpose is hereby granted without fee, provided that
7 * the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Keith Packard not be used in
10 * advertising or publicity pertaining to distribution of the software without
11 * specific, written prior permission. Keith Packard makes no
12 * representations about the suitability of this software for any purpose. It
13 * is provided "as is" without express or implied warranty.
15 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
17 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
19 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
20 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21 * PERFORMANCE OF THIS SOFTWARE.
24 #ifdef HAVE_DIX_CONFIG_H
25 #include <dix-config.h>
28 #include "scrnintstr.h"
30 #include "pixmapstr.h"
31 #include "windowstr.h"
33 #include "picturestr.h"
37 miPointFixedBounds(int npoint
, xPointFixed
* points
, BoxPtr bounds
)
39 bounds
->x1
= xFixedToInt(points
->x
);
40 bounds
->x2
= xFixedToInt(xFixedCeil(points
->x
));
41 bounds
->y1
= xFixedToInt(points
->y
);
42 bounds
->y2
= xFixedToInt(xFixedCeil(points
->y
));
45 while (npoint
-- > 0) {
46 INT16 x1
= xFixedToInt(points
->x
);
47 INT16 x2
= xFixedToInt(xFixedCeil(points
->x
));
48 INT16 y1
= xFixedToInt(points
->y
);
49 INT16 y2
= xFixedToInt(xFixedCeil(points
->y
));
53 else if (x2
> bounds
->x2
)
57 else if (y2
> bounds
->y2
)
64 miTriangleBounds(int ntri
, xTriangle
* tris
, BoxPtr bounds
)
66 miPointFixedBounds(ntri
* 3, (xPointFixed
*) tris
, bounds
);