[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/opengl

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 27 08:55:20 UTC 2019


 vcl/opengl/gdiimpl.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 91aaf86ad6137cbdef2ab6772f37503af0ba0e2b
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Mar 22 13:39:17 2019 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Mar 27 09:54:58 2019 +0100

    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: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit c4217f888a2964ca1371bd22297895b4737d2c38)
    Reviewed-on: https://gerrit.libreoffice.org/69669
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 4145eda816f1..938e57e041ff 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1746,7 +1746,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();
 }
 


More information about the Libreoffice-commits mailing list