summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/bitmap.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-04-06 13:38:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-07 21:24:17 +0200
commitf1a57c38681eda897e42ae0358556f4d55e45dad (patch)
tree1363a288798b7a6c1bfd81048a0fece478312542 /vcl/source/bitmap/bitmap.cxx
parentbd3019d24af91ee264783ed9d9d1d8bb624ff159 (diff)
can short-circuit this conversion
Change-Id: I042bcd0ea9d64ab5d9cca301a04235a89b1e4fbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113662 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/bitmap/bitmap.cxx')
-rw-r--r--vcl/source/bitmap/bitmap.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index 656e9bd15528..7bf272225d6c 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -945,6 +945,8 @@ bool Bitmap::Convert( BmpConversion eConversion )
// avoid large chunk of obsolete and hopefully rarely used conversions.
if (eConversion == BmpConversion::N8BitNoConversion)
{
+ if (mxSalBmp->GetBitCount() == 8 && HasGreyPalette8Bit())
+ return true;
std::shared_ptr<SalBitmap> xImpBmp(ImplGetSVData()->mpDefInst->CreateSalBitmap());
// frequently used conversion for creating alpha masks
if (xImpBmp->Create(*mxSalBmp) && xImpBmp->InterpretAs8Bit())