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 <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9528
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 86514450b4655f8e5623362c54d0153f5887d753)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209517
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Mike Kaganski
2026-08-23 13:28:19 +02:00
committed by Xisco Fauli
parent f03760a4b4
commit f1e01466f0
+5 -2
View File
@@ -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<tools::Long>(aLogicBitmapRange.getWidth()),
basegfx::fround<tools::Long>(aLogicBitmapRange.getHeight())),
Bitmap(rBitmap.CreateColorBitmap(), aAlpha)));
Bitmap(aColorBitmap, aAlpha)));
return true;
}