From f1e01466f0791c499f74a34df58edf4c94eb4b15 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 19 Aug 2026 11:12:58 +0000 Subject: [PATCH] CreateAlphaMask + CreateColorBitmap -> SplitIntoColorAndAlpha See commit f7b67e6c8c5981790fb9ac162dcc68e470b53112 (pdfexport: reduce the number of times we split images, 2026-08-19) for rationale. Change-Id: If2caeff175ed120dde336c40f5e96ccd8157d5ad Signed-off-by: Mike Kaganski Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9528 Reviewed-by: Noel Grandin Tested-by: Jenkins CPCI (cherry picked from commit 86514450b4655f8e5623362c54d0153f5887d753) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209517 Reviewed-by: Xisco Fauli Tested-by: Xisco Fauli --- vcl/source/gdi/gdimetafiletools.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index b3343911d2a5..c008658bc26c 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -174,10 +174,13 @@ namespace aVDev->SetFillColor( COL_WHITE); aVDev->SetLineColor(); + Bitmap aColorBitmap(rBitmap); if(rBitmap.HasAlpha()) { // use given alpha channel - aVDev->DrawBitmap(Point(0, 0), rBitmap.CreateAlphaMask().GetBitmap()); + AlphaMask aAlpha; + std::tie(aColorBitmap, aAlpha) = rBitmap.SplitIntoColorAndAlpha(); + aVDev->DrawBitmap(Point(0, 0), aAlpha.GetBitmap()); } else { @@ -229,7 +232,7 @@ namespace Size( basegfx::fround(aLogicBitmapRange.getWidth()), basegfx::fround(aLogicBitmapRange.getHeight())), - Bitmap(rBitmap.CreateColorBitmap(), aAlpha))); + Bitmap(aColorBitmap, aAlpha))); return true; }