summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-12-11 14:41:30 -0800
committerEmil Velikov <[email protected]>2016-06-15 09:29:10 +0100
commitdd1943f9045a8cd266e26cfb914ea15d7070bcb3 (patch)
treec782992b35e9593ef37f58bad9ee0bd5e92842cc
parent6eb0240a325ee5a6e8248be860058d8aadbd67fc (diff)
mesa: Fix region overlap conditions for rectangles with a shared edge
>From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels": "The pixels corresponding to these buffers are copied from the source rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1) to the destination rectangle bounded by the locations (dstX0, dstY 0) and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive, while the upper bounds are exclusive." So, the rectangles sharing just an edge shouldn't overlap. ----------- | | ------- --- | | | | | | ------- --- Cc: "12.0" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> (cherry picked from commit f8679badd423b61b3a49e1138445f9f3d740fdde)
-rw-r--r--src/mesa/main/blit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
index 5729e601c12..e739130f984 100644
--- a/src/mesa/main/blit.c
+++ b/src/mesa/main/blit.c
@@ -68,16 +68,16 @@ _mesa_regions_overlap(int srcX0, int srcY0,
int dstX0, int dstY0,
int dstX1, int dstY1)
{
- if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
+ if (MAX2(srcX0, srcX1) <= MIN2(dstX0, dstX1))
return false; /* dst completely right of src */
- if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
+ if (MAX2(dstX0, dstX1) <= MIN2(srcX0, srcX1))
return false; /* dst completely left of src */
- if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
+ if (MAX2(srcY0, srcY1) <= MIN2(dstY0, dstY1))
return false; /* dst completely above src */
- if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
+ if (MAX2(dstY0, dstY1) <= MIN2(srcY0, srcY1))
return false; /* dst completely below src */
return true; /* some overlap */