Kaydet (Commit) b0c475a0 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst ccc53c51
...@@ -581,7 +581,7 @@ bool OpenGLSalBitmap::ReadTexture() ...@@ -581,7 +581,7 @@ bool OpenGLSalBitmap::ReadTexture()
xContext->state().scissor().disable(); xContext->state().scissor().disable();
xContext->state().stencil().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); determineTextureFormat(mnBits, nFormat, nType);
......
...@@ -182,6 +182,8 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con ...@@ -182,6 +182,8 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con
{ {
rParameters.mbWriteImageToCache = true; // Cache the scaled variant rParameters.mbWriteImageToCache = true; // Cache the scaled variant
double aScaleFactor(aScalePercentage / 100.0); 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); rParameters.mrBitmap.Scale(aScaleFactor, aScaleFactor, BmpScaleFlag::Fast);
} }
} }
......
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