diff options
author | Russell King <rmk@arm.linux.org.uk> | 2016-01-07 19:21:14 +0000 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2016-01-07 19:21:14 +0000 |
commit | 8acfb2b61dc5aeb28b99e3221876b4f0bd3bfeb3 (patch) | |
tree | 011a497303d17539fa4bb16ddaf83d874df570ad | |
parent | b38171be4051bf9269359567d4dada15f249060a (diff) |
etnaviv: work around miComputeCompositeRegion()
The comment above miComputeCompositeRegion() says:
/*
* returns FALSE if the final region is empty. Indistinguishable from
* an allocation failure, but rendering ignores those anyways.
*/
This is not true in at least Xorg 1.17 - it returns TRUE despite the
region being clipped away, and the final region being empty:
{extents = {x1 = 0, y1 = 0, x2 = 0, y2 = 0}, data = 0x1fda60 <RegionEmptyData>}
This appears to be due to the RegionIntersect() in miClipPictureSrc()
returning TRUE when RegionIntersect() determines that the region is
empty. The failing case is:
miComputeCompositeRegion(®ion, pSrc, 0, pDst, 0, 0, 0, 0, 0, 0, 1920, 1080)
where pSrc->clientClip is:
{extents = {x1 = -1000, y1 = -1000, x2 = -995, y2 = -995}, data = 0x0}
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_render.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c index 46bc181..a3abb3b 100644 --- a/etnaviv/etnaviv_render.c +++ b/etnaviv/etnaviv_render.c @@ -477,7 +477,14 @@ static Bool etnaviv_compute_composite_region(RegionPtr region, return miComputeCompositeRegion(region, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, - xDst, yDst, width, height); + xDst, yDst, width, height) && + /* Xorg 1.17 can return TRUE, despite the region being + * empty, which goes against the comment immediately + * above miComputeCompositeRegion(). It appears to be + * a pixman bug, with pixman_region_intersect() returning + * TRUE even though the resulting region is empty. + */ + RegionNotEmpty(region); } static Bool etnaviv_Composite_Clear(PicturePtr pDst, struct etnaviv_de_op *op) |