desktop/source/splash/splash.cxx | 6 +++--- include/vcl/settings.hxx | 4 ++-- include/vcl/svapp.hxx | 6 +++--- sw/source/core/view/viewsh.cxx | 4 ++-- vcl/source/app/brand.cxx | 6 +++--- vcl/source/app/settings.cxx | 14 +++++++------- vcl/workben/vcldemo.cxx | 9 +++------ 7 files changed, 23 insertions(+), 26 deletions(-)
New commits: commit 3157842e41d9ba44fb42c78110b62dbf00fb10b7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 6 14:57:03 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 6 19:52:25 2025 +0200 BitmapEx->Bitmap in Application not that Bitmap can do transparency Change-Id: I42e1acc916c9868a3c8678d5975e335d435acea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 3392e9f5e886..57b34017b023 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -72,10 +72,10 @@ private: virtual ~SplashScreen() override; void loadConfig(); void updateStatus(); - void SetScreenBitmap(BitmapEx &rBitmap); + void SetScreenBitmap(Bitmap& rBitmap); static void determineProgressRatioValues( double& rXRelPos, double& rYRelPos, double& rRelWidth, double& rRelHeight ); - BitmapEx _aIntroBmp; + Bitmap _aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; Color _cProgressTextColor; @@ -454,7 +454,7 @@ void SplashScreen::loadConfig() } } -void SplashScreen::SetScreenBitmap(BitmapEx &rBitmap) +void SplashScreen::SetScreenBitmap(Bitmap& rBitmap) { sal_Int32 nWidth( 0 ); sal_Int32 nHeight( 0 ); diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 4cb6c658511e..058402d4b5e1 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -44,7 +44,7 @@ #include <com/sun/star/uno/Reference.h> -class BitmapEx; +class Bitmap; namespace weld { class Builder; @@ -931,11 +931,11 @@ public: /** Load a localized branding PNG file as a bitmap. @param pName Name of the bitmap to load. - @param rBitmap Reference to BitmapEx object to load PNG into + @param rBitmap Reference to Bitmap object to load PNG into @returns true if the PNG could be loaded, otherwise returns false. */ - static bool LoadBrandBitmap (std::u16string_view pName, BitmapEx &rBitmap); + static bool LoadBrandBitmap (std::u16string_view pName, Bitmap& rBitmap); ///@} diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx index 78493d58eb30..4eba453b9658 100644 --- a/vcl/source/app/brand.cxx +++ b/vcl/source/app/brand.cxx @@ -34,7 +34,7 @@ #include <vcl/svapp.hxx> namespace { - bool loadPng( std::u16string_view rPath, BitmapEx &rBitmap) + bool loadPng( std::u16string_view rPath, Bitmap& rBitmap) { INetURLObject aObj( rPath ); SvFileStream aStrm( aObj.PathToFileName(), StreamMode::STD_READ ); @@ -46,13 +46,13 @@ namespace { else return false; } - bool tryLoadPng( std::u16string_view rBaseDir, std::u16string_view rName, BitmapEx& rBitmap ) + bool tryLoadPng( std::u16string_view rBaseDir, std::u16string_view rName, Bitmap& rBitmap ) { return loadPng( rtl::Concat2View(OUString::Concat(rBaseDir) + "/" LIBO_ETC_FOLDER + rName), rBitmap); } } -bool Application::LoadBrandBitmap (std::u16string_view pName, BitmapEx &rBitmap) +bool Application::LoadBrandBitmap (std::u16string_view pName, Bitmap& rBitmap) { // TODO - if we want more flexibility we could add a branding path // in an rc file perhaps fallback to "about.bmp" diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 4087ff800de6..cdc858ec91ee 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -75,8 +75,7 @@ enum RenderStyle { class DemoRenderer { - Bitmap maIntroBW; - BitmapEx maIntro; + Bitmap maIntro; int mnSegmentsX; int mnSegmentsY; @@ -133,9 +132,7 @@ public: if (!Application::LoadBrandBitmap(u"intro", maIntro)) Application::Abort(u"Failed to load intro image"_ustr); - maIntroBW = maIntro.GetBitmap(); - - BitmapFilter::Filter(maIntroBW, BitmapEmbossGreyFilter(0_deg100, 0_deg100)); + BitmapFilter::Filter(maIntro, BitmapEmbossGreyFilter(0_deg100, 0_deg100)); InitRenderers(); mnSegmentsY = rtl::math::round(std::sqrt(maRenderers.size()), 0, @@ -865,7 +862,7 @@ public: virtual void RenderRegion(OutputDevice &rDev, tools::Rectangle r, const RenderContext &rCtx) override { - Bitmap aBitmap(rCtx.mpDemoRenderer->maIntroBW); + Bitmap aBitmap(rCtx.mpDemoRenderer->maIntro); aBitmap.Scale(r.GetSize(), BmpScaleFlag::BestQuality); rDev.DrawBitmap(r.TopLeft(), aBitmap); commit 3ea5a1280e536c43c4248b0c64fee7013e43e877 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 6 14:52:01 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Aug 6 19:52:15 2025 +0200 BitmapEx->Bitmap in StyleSettings now that Bitmap can handle transparency Change-Id: I3f04232e433698f520deb99ab16e6232e2ecd1db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189007 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index d6203fe3e1e6..7d3bb987f206 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -32,7 +32,7 @@ #include <memory> #include <vector> -class BitmapEx; +class Bitmap; class LanguageTag; class SvtSysLocale; @@ -607,7 +607,7 @@ public: void SetPreferredIconTheme(const OUString&, bool bDarkIconTheme = false); const DialogStyle& GetDialogStyle() const; - const BitmapEx& GetAppBackgroundBitmap() const; + const Bitmap& GetAppBackgroundBitmap() const; // global switch to allow EdgeBlenging; currently possible for ValueSet and ListBox // when activated there using Get/SetEdgeBlending; default is true diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index a264b15976d6..706106f1ba02 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1863,12 +1863,12 @@ bool SwViewShell::DrawAppBackgroundBitmap(vcl::RenderContext* rRenderContext, co if (Application::IsHeadlessModeEnabled() || !ThemeColors::UseBmpForAppBack()) return false; - const BitmapEx& aAppBackImg + const Bitmap& aAppBackImg = Application::GetSettings().GetStyleSettings().GetAppBackgroundBitmap(); if (aAppBackImg.IsEmpty()) return false; - Wallpaper aWallpaper(aAppBackImg); + Wallpaper aWallpaper((BitmapEx(aAppBackImg))); if (ThemeColors::GetAppBackBmpDrawType() == u"Tiled"_ustr) aWallpaper.SetStyle(WallpaperStyle::Tile); else if (ThemeColors::GetAppBackBmpDrawType() == u"Stretched"_ustr) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index d5fa673d6385..6add26b29d3d 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -250,7 +250,7 @@ struct ImplStyleData Size maListBoxPreviewDefaultLogicSize = getInitListBoxPreviewDefaultLogicSize(); // on-demand calculated in GetListBoxPreviewDefaultPixelSize() Size mutable maListBoxPreviewDefaultPixelSize; - BitmapEx mutable maAppBackgroundBitmap; // cache AppBackground bitmap + Bitmap mutable maAppBackgroundBitmap; // cache AppBackground bitmap OUString mutable maAppBackgroundBitmapFileName; // cache AppBackground bitmap file name bool operator==(const ImplStyleData& rSet) const; @@ -1953,7 +1953,7 @@ StyleSettings::GetDialogStyle() const return mxData->maDialogStyle; } -static BitmapEx readBitmapEx(const OUString& rPath) +static Bitmap readBitmap(const OUString& rPath) { OUString aPath(rPath); rtl::Bootstrap::expandMacros(aPath); @@ -1961,11 +1961,11 @@ static BitmapEx readBitmapEx(const OUString& rPath) // import the image Graphic aGraphic; if (GraphicFilter::LoadGraphic(aPath, OUString(), aGraphic) != ERRCODE_NONE) - return BitmapEx(); - return aGraphic.GetBitmapEx(); + return Bitmap(); + return Bitmap(aGraphic.GetBitmapEx()); } -static void setupAppBackgroundBitmap(OUString& rAppBackBitmapFileName, BitmapEx& rAppBackBitmap) +static void setupAppBackgroundBitmap(OUString& rAppBackBitmapFileName, Bitmap& rAppBackBitmap) { if (Application::IsHeadlessModeEnabled() || !ThemeColors::UseBmpForAppBack()) return; @@ -1978,7 +1978,7 @@ static void setupAppBackgroundBitmap(OUString& rAppBackBitmapFileName, BitmapEx& if (!rAppBackBitmapFileName.isEmpty()) { - rAppBackBitmap = readBitmapEx("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/gallery/backgrounds/" + rAppBackBitmap = readBitmap("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/gallery/backgrounds/" + rAppBackBitmapFileName); } @@ -1989,7 +1989,7 @@ static void setupAppBackgroundBitmap(OUString& rAppBackBitmapFileName, BitmapEx& } } -BitmapEx const& StyleSettings::GetAppBackgroundBitmap() const +Bitmap const& StyleSettings::GetAppBackgroundBitmap() const { setupAppBackgroundBitmap(mxData->maAppBackgroundBitmapFileName, mxData->maAppBackgroundBitmap); return mxData->maAppBackgroundBitmap;