OSDN Git Service

gallium/util: fix returning empty box for rectangle intersection
authorRoland Scheidegger <sroland@vmware.com>
Tue, 1 Sep 2015 22:29:17 +0000 (16:29 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 1 Sep 2015 22:29:17 +0000 (16:29 -0600)
commit17542086174ed1c2ea47f3b9b5917ce478442819
treef8754752636da1035e5ecfcfd1b698991b2aaf4b
parentfec4f5de67b22a7048266fb7e57f49fe6fc3744a
gallium/util: fix returning empty box for rectangle intersection

These functions deal with inclusive coordinates, hence a 0/0/0/0 rect
returned when there's no intersection doesn't actually represent an empty
rectangle. Hence return 0/-1/0/-1 instead.
This fixes some problems in llvmpipe with empty scissor rects (which up
to now didn't really matter because while the intersect test returned the
wrong result all pixels were scissored away later anyway).
src/gallium/auxiliary/util/u_rect.h