diff options
author | Russell King <rmk@armlinux.org.uk> | 2016-11-22 15:05:34 +0000 |
---|---|---|
committer | Russell King <rmk@armlinux.org.uk> | 2016-11-22 15:16:51 +0000 |
commit | b12b32ce835ce3bf90cc76b53158c9f00a6e3192 (patch) | |
tree | de50dbe9aadb3e1fef696d0ced0e7e2f5a2eec4e | |
parent | 4f2ba2d8cc752378a4ef7c3bb93c4928b6fb4612 (diff) |
etnaviv: take account of mask coordinates in render
Lucas Stach reports that we were overwriting the mask coordinates when
getting the drawable. This means we end up ignoring the requested mask
coordinates, translation, and drawable position.
This is a simplified version of Lucas' original patch.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r-- | etnaviv/etnaviv_render.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c index d547aef..a131d1c 100644 --- a/etnaviv/etnaviv_render.c +++ b/etnaviv/etnaviv_render.c @@ -641,6 +641,7 @@ static int etnaviv_accel_composite_masked(PicturePtr pSrc, PicturePtr pMask, } if (pMask->pDrawable) { + xPoint mo; int tx, ty; if (!transform_is_integer_translation(pMask->transform, &tx, &ty)) @@ -656,18 +657,21 @@ static int etnaviv_accel_composite_masked(PicturePtr pSrc, PicturePtr pMask, mask_offset.x += pMask->pDrawable->x; mask_offset.y += pMask->pDrawable->y; + + /* + * Check whether the mask has a etna bo backing it. If not, + * fallback to software for the mask operation. + */ + vMask = etnaviv_drawable_offset(pMask->pDrawable, &mo); + if (!vMask) + goto fallback; + + mask_offset.x += mo.x; + mask_offset.y += mo.y; } else { goto fallback; } - /* - * Check whether the mask has a etna bo backing it. If not, - * fallback to software for the mask operation. - */ - vMask = etnaviv_drawable_offset(pMask->pDrawable, &mask_offset); - if (!vMask) - goto fallback; - etnaviv_set_format(vMask, pMask); /* |