summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2019-12-28 20:53:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-12-29 19:00:53 +0100
commit50c302a280763968d1bc01f2fc7bd38dd463bb79 (patch)
tree58d803863c7f17d4ddcbb24367ec56d7760d93a3
parentf1656f7db9c0e00b1c9907d382a3e5e4cbdc5edd (diff)
support converting images to 32-bit
not sure where this is coming from, but without it, I see warning messages about bitmaps having the wrong depth Change-Id: Iee1a68ced73333a22b811dc31afb32df14709f18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85946 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/vcl/bitmap.hxx1
-rw-r--r--vcl/source/gdi/bitmap3.cxx14
2 files changed, 15 insertions, 0 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 3d57e5dfe741..329a40ec6ef1 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -71,6 +71,7 @@ enum class BmpConversion
N8BitGreys,
N8BitColors,
N24Bit,
+ N32Bit,
N8BitTrans,
Ghosted
};
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 68d590bc6eeb..0ee707089f26 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -305,6 +305,15 @@ bool Bitmap::Convert( BmpConversion eConversion )
}
break;
+ case BmpConversion::N32Bit:
+ {
+ if( nBitCount < 32 )
+ bRet = ImplConvertUp( 32 );
+ else
+ bRet = true;
+ }
+ break;
+
case BmpConversion::Ghosted:
bRet = ImplConvertGhosted();
break;
@@ -884,6 +893,11 @@ void Bitmap::AdaptBitCount(Bitmap& rNew) const
rNew.Convert(BmpConversion::N24Bit);
break;
}
+ case 32:
+ {
+ rNew.Convert(BmpConversion::N32Bit);
+ break;
+ }
default:
{
SAL_WARN("vcl", "BitDepth adaptation failed, from " << rNew.GetBitCount() << " to " << GetBitCount());