avmedia/source/qt6/QtFrameGrabber.cxx | 6 +++--- include/vcl/BitmapTools.hxx | 2 +- vcl/source/bitmap/BitmapTools.cxx | 4 ++-- vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 14 ++++++++------ vcl/source/image/ImplImageTree.cxx | 6 ++++-- 5 files changed, 18 insertions(+), 14 deletions(-)
New commits: commit 32627a5807b8b9ea0dff6339ee6b98867746dd07 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 6 15:48:28 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 6 19:52:48 2025 +0200 blind fix for qt6 build After commit 88e9af00f2b5e7ae01f3c061485ffb9e99598fd3 Author: Noel Grandin <noelgran...@gmail.com> Date: Wed Aug 6 09:49:42 2025 +0200 BitmapEx->Bitmap in PngImageReader I don't have the requisite libraries to build qt6, so lets see if this helps Change-Id: I5e89ae76190a51c1928a9f7605471c3db068e76d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189011 Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> Tested-by: Jenkins diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx b/avmedia/source/qt6/QtFrameGrabber.cxx index 3e62a69d5f26..5c70f5890b00 100644 --- a/avmedia/source/qt6/QtFrameGrabber.cxx +++ b/avmedia/source/qt6/QtFrameGrabber.cxx @@ -32,9 +32,9 @@ uno::Reference<css::graphic::XGraphic> toXGraphic(const QImage& rImage) SvMemoryStream aStream(aData.data(), aData.size(), StreamMode::READ); vcl::PngImageReader aReader(aStream); - BitmapEx aBitmapEx; - if (aReader.read(aBitmapEx)) - return Graphic(aBitmapEx).GetXGraphic(); + Bitmap aBitmap; + if (aReader.read(aBitmap)) + return Graphic(aBitmap).GetXGraphic(); return nullptr; } commit 926d31f99250ac2fb0c76388b51986263ee8dedf Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 6 15:22:29 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 6 19:52:33 2025 +0200 BitmapEx->Bitmap in loadFromSvg now that Bitmap supports transparency Change-Id: I446132cd48b876e70b0ff84e1bf8ef6c8783799c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189009 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx index dc4d10091700..27eeb24364f2 100644 --- a/include/vcl/BitmapTools.hxx +++ b/include/vcl/BitmapTools.hxx @@ -40,7 +40,7 @@ VCL_DLLPUBLIC sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a); BitmapEx VCL_DLLPUBLIC loadFromName(const OUString& rFileName, const ImageLoadFlags eFlags = ImageLoadFlags::NONE); -void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, double fScaleFactor); +void loadFromSvg(SvStream& rStream, const OUString& sPath, Bitmap& rBitmap, double fScaleFactor); /** Copy block of image data into the bitmap. Assumes that the Bitmap has been constructed with the desired size. diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index 7e6f864f0e6d..5b36f9140893 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -69,7 +69,7 @@ BitmapEx loadFromName(const OUString& rFileName, const ImageLoadFlags eFlags) return aBitmapEx; } -void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, double fScalingFactor) +void loadFromSvg(SvStream& rStream, const OUString& sPath, Bitmap& rBitmap, double fScalingFactor) { const uno::Reference<uno::XComponentContext>& xContext(comphelper::getProcessComponentContext()); const uno::Reference<graphic::XSvgParser> xSvgParser = graphic::SvgTools::create(xContext); @@ -114,7 +114,7 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx, if (xBitmap.is()) { const css::uno::Reference<css::rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap, uno::UNO_QUERY_THROW); - rBitmapEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp); + rBitmap = Bitmap(vcl::unotools::bitmapExFromXBitmap(xIntBmp)); } } diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index e87c825442d0..ab83e0aef358 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -466,7 +466,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr OUString rCacheKey = rWidgetDraw.msSource + "@" + OUString::number(nScaleFactor); auto aIterator = rCacheImages.find(rCacheKey); - BitmapEx aBitmap; + Bitmap aBitmap; if (aIterator == rCacheImages.end()) { SvFileStream aFileStream(rWidgetDraw.msSource, StreamMode::READ); @@ -474,7 +474,7 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr vcl::bitmap::loadFromSvg(aFileStream, u""_ustr, aBitmap, nScaleFactor); if (!aBitmap.IsEmpty()) { - rCacheImages.insert(std::make_pair(rCacheKey, Bitmap(aBitmap))); + rCacheImages.insert(std::make_pair(rCacheKey, aBitmap)); } } else @@ -488,17 +488,19 @@ void munchDrawCommands(std::vector<std::shared_ptr<WidgetDrawAction>> const& rDr nImageHeight / nScaleFactor); if (!aBitmap.IsEmpty()) { - const std::shared_ptr<SalBitmap> pSalBitmap - = aBitmap.GetBitmap().ImplGetSalBitmap(); - if (aBitmap.IsAlpha()) + if (aBitmap.HasAlpha()) { + BitmapEx aTmp(aBitmap); + const std::shared_ptr<SalBitmap> pSalBitmap + = aTmp.GetBitmap().ImplGetSalBitmap(); const std::shared_ptr<SalBitmap> pSalBitmapAlpha - = aBitmap.GetAlphaMask().GetBitmap().ImplGetSalBitmap(); + = aTmp.GetAlphaMask().GetBitmap().ImplGetSalBitmap(); FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap, *pSalBitmapAlpha); } else { + const std::shared_ptr<SalBitmap> pSalBitmap = aBitmap.ImplGetSalBitmap(); FileDefinitionWidgetDraw::drawBitmap(rGraphics, aTR, *pSalBitmap); } } diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index be037ee56729..1232734f4e72 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -181,13 +181,15 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con else if (rPath.endsWith(".svg")) { rParameters.mbWriteImageToCache = true; // We always want to cache a SVG image + Bitmap aTmp; #ifdef _WIN32 // tdf#153421. Do not scale, individual crop handles are created from it using pixel unit. if (rPath.endsWith("cropmarkers.svg")) - vcl::bitmap::loadFromSvg(*xStream, rPath, rParameters.mrBitmap, 1.0); + vcl::bitmap::loadFromSvg(*xStream, rPath, aTmp, 1.0); else #endif - vcl::bitmap::loadFromSvg(*xStream, rPath, rParameters.mrBitmap, aScalePercentage / 100.0); + vcl::bitmap::loadFromSvg(*xStream, rPath, aTmp, aScalePercentage / 100.0); + rParameters.mrBitmap = aTmp; if (bConvertToDarkTheme) BitmapFilter::Filter(rParameters.mrBitmap, BitmapLightenFilter());