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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 31 19:13:19 UTC 2018


 vcl/opengl/salbmp.cxx              |    2 +-
 vcl/source/image/ImplImageTree.cxx |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 47789c45dfc7ba8509eedab37f1dbd70ea79da41
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Oct 29 09:39:17 2018 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 31 20:12:53 2018 +0100

    tdf#119020 always scale icons as 24bit RGB
    
    We don't really care for the palette or even lower bitness of the
    original icons, when scaling them. So just convert them to 24bit
    to get the best scaling quality.
    
    And also actually fail the OpenGL scaling for 8bit color icons,
    instead of handling them as a grayscale image, which results in
    "funny" luminance based color icons.
    
    Change-Id: I62ff9e7cd45dbffba81b0db5a0252737b6189059
    Reviewed-on: https://gerrit.libreoffice.org/62505
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    (cherry picked from commit b0c475a00ced9ec1e4ef1efb9d184ee8e2a3eaab)
    Reviewed-on: https://gerrit.libreoffice.org/62685
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 33fc720ef497..6e497ff71d74 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -582,7 +582,7 @@ bool OpenGLSalBitmap::ReadTexture()
     xContext->state().scissor().disable();
     xContext->state().stencil().disable();
 
-    if (mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32)
+    if ((mnBits == 8 && maPalette.IsGreyPalette()) || mnBits == 16 || mnBits == 24 || mnBits == 32)
     {
         determineTextureFormat(mnBits, nFormat, nType);
 
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index d48cd3044b07..039a909c61b7 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -181,6 +181,8 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con
     {
         rParameters.mbWriteImageToCache = true; // Cache the scaled variant
         double aScaleFactor(aScalePercentage / 100.0);
+        // when scaling use the full 24bit RGB values
+        rParameters.mrBitmap.Convert(BmpConversion::N24Bit);
         rParameters.mrBitmap.Scale(aScaleFactor, aScaleFactor, BmpScaleFlag::Fast);
     }
 }


More information about the Libreoffice-commits mailing list