diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-05-27 15:51:19 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-05-27 15:51:19 -0400 |
commit | 6e6927247359cc0db47501fb9d2dbb7856aa5985 (patch) | |
tree | fdafaa3e5c9c02728ba38a225ff6fdbdca27037b /render | |
parent | ebfd6688d1927288155221e7a78fbca9f9293952 (diff) |
Fix alpha map computation in miComputeCompositeRegion()
According to the RENDER spec, the origin of the alpha map is
interpreted relative to the origin of the drawable of the image, not
the origin of the drawable of the alpha map.
This commit fixes that and adds an alpha-test.c test program.
The only use of alpha maps I have been able to find is in Qt and they
don't use a non-zero alpha origin.
Diffstat (limited to 'render')
-rw-r--r-- | render/mipict.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/render/mipict.c b/render/mipict.c index c653ec4f5..e0d40ae34 100644 --- a/render/mipict.c +++ b/render/mipict.c @@ -459,8 +459,8 @@ miComputeCompositeRegion (RegionPtr pRegion, if (pSrc->alphaMap) { if (!miClipPictureSrc (pRegion, pSrc->alphaMap, - xDst - (xSrc + pSrc->alphaOrigin.x), - yDst - (ySrc + pSrc->alphaOrigin.y))) + xDst - (xSrc - pSrc->alphaOrigin.x), + yDst - (ySrc - pSrc->alphaOrigin.y))) { pixman_region_fini (pRegion); return FALSE; @@ -477,8 +477,8 @@ miComputeCompositeRegion (RegionPtr pRegion, if (pMask->alphaMap) { if (!miClipPictureSrc (pRegion, pMask->alphaMap, - xDst - (xMask + pMask->alphaOrigin.x), - yDst - (yMask + pMask->alphaOrigin.y))) + xDst - (xMask - pMask->alphaOrigin.x), + yDst - (yMask - pMask->alphaOrigin.y))) { pixman_region_fini (pRegion); return FALSE; |