diff options
author | marha <marha@users.sourceforge.net> | 2014-11-29 16:13:30 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-11-29 16:13:30 +0100 |
commit | 7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c (patch) | |
tree | e5b941fdff86328a065c46582ba53e0cc73c8576 /mesalib/src/gallium/auxiliary/util/u_rect.h | |
parent | 0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6 (diff) | |
parent | a1011d63ffb5cc4f41bf0f4622ee3f1493d419d9 (diff) | |
download | vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.tar.gz vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.tar.bz2 vcxsrv-7147e58c389cffeb930bdd8e3a2fdfc5d5bb3a0c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/dix/dispatch.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glshim.c
xorg-server/hw/xwin/winclipboard/xevents.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winprefslex.l
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/mi/miarc.c
xorg-server/os/connection.c
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_rect.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_rect.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_rect.h b/mesalib/src/gallium/auxiliary/util/u_rect.h index dd87f81f3..cf29dff0d 100644 --- a/mesalib/src/gallium/auxiliary/util/u_rect.h +++ b/mesalib/src/gallium/auxiliary/util/u_rect.h @@ -30,6 +30,7 @@ #define U_RECT_H #include "pipe/p_compiler.h" +#include "util/u_math.h" #ifdef __cplusplus extern "C" { @@ -67,6 +68,12 @@ u_rect_find_intersection(const struct u_rect *a, } +static INLINE int +u_rect_area(const struct u_rect *r) +{ + return (r->x1 - r->x0) * (r->y1 - r->y0); +} + static INLINE void u_rect_possible_intersection(const struct u_rect *a, struct u_rect *b) @@ -79,6 +86,17 @@ u_rect_possible_intersection(const struct u_rect *a, } } +/* Set @d to a rectangle that covers both @a and @b. + */ +static INLINE void +u_rect_union(struct u_rect *d, const struct u_rect *a, const struct u_rect *b) +{ + d->x0 = MIN2(a->x0, b->x0); + d->y0 = MIN2(a->y0, b->y0); + d->x1 = MAX2(a->x1, b->x1); + d->y1 = MAX2(a->y1, b->y1); +} + #ifdef __cplusplus } #endif |