[Libreoffice-commits] core.git: Branch 'feature/fixes18' - 3 commits - vcl/opengl

Marco Cecchetti marco.cecchetti at collabora.com
Fri Mar 18 12:26:28 UTC 2016


 vcl/opengl/scale.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 1496a89318acedafa9daae4243d9130d6bff5289
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Fri Mar 18 13:23:13 2016 +0100

    Reapply "area scale shader - 2 passes impl - sqrt scale factor"
    
    This reverts commit 5cbe0cf3a2d055aca25d9d960c4d51ab52677499.
    
    Change-Id: I0b07b9a30146d540e9184f2c990d1f3dfa4d5105

diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 3f6375f..d279229 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -219,28 +219,16 @@ bool OpenGLSalBitmap::ImplScaleArea( const rtl::Reference< OpenGLContext > &xCon
     }
     else
     {
-        if (ixscale > 16)
+        if (ixscale > 16 || iyscale > 16)
         {
-            ixscale = 16;
+            ixscale = std::floor(std::sqrt(ixscale));
+            iyscale = std::floor(std::sqrt(iyscale));
             nNewWidth = int(mnWidth / ixscale);
             rScaleX *= ixscale; // second pass x-scale factor
-            bTwoPasses = true;
-        }
-        else
-        {
-            rScaleX = 1;
-        }
-        if (iyscale > 16)
-        {
-            iyscale = 16;
             nNewHeight = int(mnHeight / iyscale);
             rScaleY *= iyscale; // second pass y-scale factor
             bTwoPasses = true;
         }
-        else
-        {
-            rScaleY = 1;
-        }
     }
 
     // TODO Make sure the framebuffer is alright
commit 817b8dbe49aa6bc81ed7b0a70030c81edbdd7f32
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Fri Mar 18 13:07:10 2016 +0100

    area scale shader - workaround for using always BestQuality
    
    Change-Id: I5a64fbadc746f004f858ee6359971404e3bab93f

diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index b86faec..3f6375f 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -343,6 +343,11 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B
     OpenGLVCLContextZone aContextZone;
     rtl::Reference<OpenGLContext> xContext = OpenGLContext::getVCLContext();
 
+    if (rScaleX <= 1 && rScaleY <= 1)
+    {
+        nScaleFlag = BmpScaleFlag::BestQuality;
+    }
+
     if( nScaleFlag == BmpScaleFlag::Fast )
     {
         return ImplScaleFilter( xContext, rScaleX, rScaleY, GL_NEAREST );
commit aba5a66243324f819c94d4c7e4c9391d46c21b62
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Fri Mar 18 12:52:27 2016 +0100

    Revert "area scale shader - 2 passes impl - sqrt scale factor"
    
    This reverts commit 5cbe0cf3a2d055aca25d9d960c4d51ab52677499.

diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 81c3193..b86faec 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -219,16 +219,28 @@ bool OpenGLSalBitmap::ImplScaleArea( const rtl::Reference< OpenGLContext > &xCon
     }
     else
     {
-        if ( ixscale > 16 || iyscale > 16 )
+        if (ixscale > 16)
         {
-            ixscale = std::floor(std::sqrt(ixscale));
-            iyscale = std::floor(std::sqrt(iyscale));
+            ixscale = 16;
             nNewWidth = int(mnWidth / ixscale);
             rScaleX *= ixscale; // second pass x-scale factor
+            bTwoPasses = true;
+        }
+        else
+        {
+            rScaleX = 1;
+        }
+        if (iyscale > 16)
+        {
+            iyscale = 16;
             nNewHeight = int(mnHeight / iyscale);
             rScaleY *= iyscale; // second pass y-scale factor
             bTwoPasses = true;
         }
+        else
+        {
+            rScaleY = 1;
+        }
     }
 
     // TODO Make sure the framebuffer is alright


More information about the Libreoffice-commits mailing list