I'm sure this has been posted before but I couldn't find it.
When performing an AlphaBlt with a Clipper set and specifying GDALPHABLT_MIRRORLEFTRIGHT with NULL source RECT, the clipped source rect is not correctly calculated.
For example, if the clipper is set to the whole destination surface, and the source surface is being blted so that it is half off the dest surface to the right, the *left* half of the source image is drawn in the destination rect. Since a mirror operation is specified, it should be the *right* edge which is drawn.
This can be worked around by implementing your own calculations for a clipped blt, which computes a source rectangle and new destination rectangle; the last bit of code you need is:
My guess is that the GapiDraw code is missing this in the clipper.
When performing an AlphaBlt with a Clipper set and specifying GDALPHABLT_MIRRORLEFTRIGHT with NULL source RECT, the clipped source rect is not correctly calculated.
For example, if the clipper is set to the whole destination surface, and the source surface is being blted so that it is half off the dest surface to the right, the *left* half of the source image is drawn in the destination rect. Since a mirror operation is specified, it should be the *right* edge which is drawn.
This can be worked around by implementing your own calculations for a clipped blt, which computes a source rectangle and new destination rectangle; the last bit of code you need is:
- Code:
// Work around the actual bug
if( dwFlags & GDALPHABLT_MIRRORLEFTRIGHT )
{
::OffsetRect( &rcSrc, cxSrc-rcSrc.right-rcSrc.left, 0 );
}
if( dwFlags & GDALPHABLT_MIRRORUPDOWN )
{
::OffsetRect( &rcSrc, 0, cySrc-rcSrc.bottom-rcSrc.top );
}
My guess is that the GapiDraw code is missing this in the clipper.