From 02bd827f39c1e37baabeea1d83921a37450e8a97 Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (allotropia)" Date: Tue, 18 Oct 2022 17:17:41 +0200 Subject: Move access to SystemDependentDataHolder to Bitmap (2) I was too positive thinking that SalBitmap would be fine, but it's locked to vcl. To be able to add system-dependent BitmapBuffering I move the access to Bitmap now. This is no functional change, but offers the same access as e.g. B2DPolygon/B2DPolyPolygon offer already. Also cleaned up usage/access to SystemDependentDataManager which removes quite some code in constructors and makes things easier in general. Change-Id: I2baa40a12479fab0fe66063a018f058c6b8f5597 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141507 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- vcl/inc/headless/BitmapHelper.hxx | 7 ++----- vcl/inc/headless/CairoCommon.hxx | 3 +-- vcl/inc/headless/svpbmp.hxx | 1 - vcl/inc/salbmp.hxx | 8 ++++---- vcl/inc/win/salbmp.h | 1 - 5 files changed, 7 insertions(+), 13 deletions(-) (limited to 'vcl/inc') diff --git a/vcl/inc/headless/BitmapHelper.hxx b/vcl/inc/headless/BitmapHelper.hxx index c86a79239d47..0aed5e3693fc 100644 --- a/vcl/inc/headless/BitmapHelper.hxx +++ b/vcl/inc/headless/BitmapHelper.hxx @@ -52,9 +52,7 @@ private: std::shared_ptr maBitmapHelper; public: - SystemDependentData_BitmapHelper( - basegfx::SystemDependentDataManager& rSystemDependentDataManager, - std::shared_ptr xBitmapHelper); + SystemDependentData_BitmapHelper(std::shared_ptr xBitmapHelper); const std::shared_ptr& getBitmapHelper() const { return maBitmapHelper; }; virtual sal_Int64 estimateUsageInBytes() const override; @@ -66,8 +64,7 @@ private: std::shared_ptr maMaskHelper; public: - SystemDependentData_MaskHelper(basegfx::SystemDependentDataManager& rSystemDependentDataManager, - std::shared_ptr xMaskHelper); + SystemDependentData_MaskHelper(std::shared_ptr xMaskHelper); const std::shared_ptr& getMaskHelper() const { return maMaskHelper; }; virtual sal_Int64 estimateUsageInBytes() const override; diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx index e8b1a4927e21..476b031c451b 100644 --- a/vcl/inc/headless/CairoCommon.hxx +++ b/vcl/inc/headless/CairoCommon.hxx @@ -96,8 +96,7 @@ private: std::vector maStroke; public: - SystemDependentData_CairoPath(basegfx::SystemDependentDataManager& rSystemDependentDataManager, - size_t nSizeMeasure, cairo_t* cr, bool bNoJoin, bool bAntiAlias, + SystemDependentData_CairoPath(size_t nSizeMeasure, cairo_t* cr, bool bNoJoin, bool bAntiAlias, const std::vector* pStroke); // MM01 virtual ~SystemDependentData_CairoPath() override; diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx index 29e730ad4d6f..cd90d23e8e22 100644 --- a/vcl/inc/headless/svpbmp.hxx +++ b/vcl/inc/headless/svpbmp.hxx @@ -61,7 +61,6 @@ public: virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override; virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override; -protected: virtual const basegfx::SystemDependentDataHolder* accessSystemDependentDataHolder() const override; }; diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index 32b1ffa14598..a48b48b2451c 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -129,13 +129,13 @@ protected: int width, int height, int bitCount, int bytesPerRow, const BitmapPalette& palette, BitConvert type ); +public: // access to SystemDependentDataHolder, to support overload in derived class(es) virtual const basegfx::SystemDependentDataHolder* accessSystemDependentDataHolder() const; -public: // exclusive management op's for SystemDependentData at SalBitmap template - std::shared_ptr getSystemDependentDataT() const + std::shared_ptr getSystemDependentData() const { const basegfx::SystemDependentDataHolder* pDataHolder(accessSystemDependentDataHolder()); if(pDataHolder) @@ -144,13 +144,13 @@ public: } template - std::shared_ptr addOrReplaceSystemDependentDataT(basegfx::SystemDependentDataManager& manager, Args&&... args) const + std::shared_ptr addOrReplaceSystemDependentData(Args&&... args) const { const basegfx::SystemDependentDataHolder* pDataHolder(accessSystemDependentDataHolder()); if(!pDataHolder) return std::shared_ptr(); - std::shared_ptr r = std::make_shared(manager, std::forward(args)...); + std::shared_ptr r = std::make_shared(std::forward(args)...); // tdf#129845 only add to buffer if a relevant buffer time is estimated if(r->calculateCombinedHoldCyclesInSeconds() > 0) diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h index 9db57b5cc9f7..d8d00e727f76 100644 --- a/vcl/inc/win/salbmp.h +++ b/vcl/inc/win/salbmp.h @@ -85,7 +85,6 @@ public: virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override; virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override; -protected: virtual const basegfx::SystemDependentDataHolder* accessSystemDependentDataHolder() const override; }; -- cgit