canvas/source/cairo/cairo_canvasfont.cxx | 12 +++++++----- canvas/source/cairo/cairo_canvasfont.hxx | 10 ++++------ canvas/source/opengl/ogl_canvasfont.cxx | 5 ++--- canvas/source/opengl/ogl_canvasfont.hxx | 8 +++----- 4 files changed, 16 insertions(+), 19 deletions(-)
New commits: commit c55d7540efdd33618950c93cabcb680e8e26c894 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Feb 24 14:03:15 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Feb 24 19:39:49 2023 +0000 BaseMutex->std::mutex in oglcanvas::CanvasFont Change-Id: I74c3132bae4076915e1e41525d7cd7e709195197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147632 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/canvas/source/opengl/ogl_canvasfont.cxx b/canvas/source/opengl/ogl_canvasfont.cxx index 7309b9acd279..213dbe92b0e5 100644 --- a/canvas/source/opengl/ogl_canvasfont.cxx +++ b/canvas/source/opengl/ogl_canvasfont.cxx @@ -23,7 +23,6 @@ namespace oglcanvas CanvasFont::CanvasFont( rendering::FontRequest aFontRequest, const uno::Sequence< beans::PropertyValue >& extraFontProperties, const geometry::Matrix2D& fontMatrix ) : - CanvasFontBaseT( m_aMutex ), maFontRequest(std::move( aFontRequest )), mnEmphasisMark(0), maFontMatrix( fontMatrix ) @@ -35,7 +34,7 @@ namespace oglcanvas sal_Int8 nDirection, sal_Int64 nRandomSeed ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) ); } @@ -54,7 +53,7 @@ namespace oglcanvas rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); return maFontRequest; } diff --git a/canvas/source/opengl/ogl_canvasfont.hxx b/canvas/source/opengl/ogl_canvasfont.hxx index 13b0f78a9d68..92e9d337b7a2 100644 --- a/canvas/source/opengl/ogl_canvasfont.hxx +++ b/canvas/source/opengl/ogl_canvasfont.hxx @@ -9,8 +9,7 @@ #pragma once -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> #include <com/sun/star/rendering/XCanvasFont.hpp> #include <com/sun/star/geometry/Matrix2D.hpp> @@ -24,10 +23,9 @@ namespace oglcanvas { class SpriteCanvas; - typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT; + typedef ::comphelper::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT; - class CanvasFont : public ::cppu::BaseMutex, - public CanvasFontBaseT + class CanvasFont : public CanvasFontBaseT { public: typedef rtl::Reference<CanvasFont> ImplRef; commit db295ca04a6a7ffa9525c43af80609801d22fb62 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Feb 24 14:02:13 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Feb 24 19:39:39 2023 +0000 BaseMutex->std::mutex in CanvasFont Change-Id: I4f10e5d33b1067adbe3987c9a103951ea175fde4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147631 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 36c1733ef62a..16af11838a91 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -39,7 +39,6 @@ namespace cairocanvas const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/, const geometry::Matrix2D& rFontMatrix, SurfaceProviderRef rDevice ) : - CanvasFont_Base( m_aMutex ), maFont( vcl::Font( rFontRequest.FontDescription.FamilyName, rFontRequest.FontDescription.StyleName, Size( 0, ::basegfx::fround(rFontRequest.CellSize) ) ) ), @@ -86,11 +85,14 @@ namespace cairocanvas pOutDev->EnableMapMode(bOldMapState); } - void SAL_CALL CanvasFont::disposing() + void CanvasFont::disposing(std::unique_lock<std::mutex>& rGuard) { - SolarMutexGuard aGuard; - - mpRefDevice.clear(); + rGuard.unlock(); + { + SolarMutexGuard aGuard; + mpRefDevice.clear(); + } + rGuard.lock(); } uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) diff --git a/canvas/source/cairo/cairo_canvasfont.hxx b/canvas/source/cairo/cairo_canvasfont.hxx index 0ebe9acd81ce..e510f420c437 100644 --- a/canvas/source/cairo/cairo_canvasfont.hxx +++ b/canvas/source/cairo/cairo_canvasfont.hxx @@ -19,8 +19,7 @@ #pragma once -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/geometry/Matrix2D.hpp> @@ -38,11 +37,10 @@ namespace cairocanvas { - typedef ::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont, + typedef ::comphelper::WeakComponentImplHelper< css::rendering::XCanvasFont, css::lang::XServiceInfo > CanvasFont_Base; - class CanvasFont : public ::cppu::BaseMutex, - public CanvasFont_Base + class CanvasFont : public CanvasFont_Base { public: typedef rtl::Reference<CanvasFont> Reference; @@ -56,7 +54,7 @@ namespace cairocanvas SurfaceProviderRef rDevice ); /// Dispose all internal references - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>& rGuard) override; // XCanvasFont virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override;