Kaydet (Commit) c4217f88 authored tarafından Luboš Luňák's avatar Luboš Luňák Kaydeden (comit) Miklos Vajna

opengl's drawBitmap() should also scale properly if needed (tdf#123372)

If the bitmap to be drawn will need to be scale for drawing, OpenGL
handles this by scaling, but the scaling is of poor quality. Other
backends scale in such a case with a good quality, and e.g. opengl's
drawAlphaBitmap() also does the same check, so copy that check
to drawBitmap() as well.

Change-Id: If6a457c69c6676d03fa4046b9910683f51479d21
Reviewed-on: https://gerrit.libreoffice.org/69556
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst e8f2f923
......@@ -1743,7 +1743,19 @@ void OpenGLSalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry, const SalBitm
VCL_GL_INFO( "::drawBitmap" );
PreDraw();
DrawTexture( rTexture, rPosAry );
if (rPosAry.mnSrcWidth != rPosAry.mnDestWidth ||
rPosAry.mnSrcHeight != rPosAry.mnDestHeight)
{
basegfx::B2DPoint aNull(rPosAry.mnDestX,rPosAry.mnDestY);
basegfx::B2DPoint aX(rPosAry.mnDestX + rPosAry.mnDestWidth, rPosAry.mnDestY);
basegfx::B2DPoint aY(rPosAry.mnDestX, rPosAry.mnDestY + rPosAry.mnDestHeight);
OpenGLTexture mask; // no mask set
DrawTransformedTexture(rTexture, mask, aNull, aX, aY);
}
else
{
DrawTexture( rTexture, rPosAry );
}
PostDraw();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment