BaseMutex->std::mutex in canvas::CachedPrimitiveBase
Change-Id: I9f7c23a4880ea09f3c9a98ad7d27b27bf35483ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -23,8 +23,7 @@
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
#include <com/sun/star/rendering/XCachedPrimitive.hpp>
|
||||
#include <com/sun/star/rendering/ViewState.hpp>
|
||||
#include <cppuhelper/compbase.hxx>
|
||||
#include <cppuhelper/basemutex.hxx>
|
||||
#include <comphelper/compbase.hxx>
|
||||
|
||||
#include <canvas/canvastoolsdllapi.h>
|
||||
|
||||
@@ -34,14 +33,14 @@ namespace com::sun::star::rendering { class XCanvas; }
|
||||
|
||||
namespace canvas
|
||||
{
|
||||
typedef cppu::WeakComponentImplHelper< css::rendering::XCachedPrimitive,
|
||||
typedef comphelper::WeakComponentImplHelper< css::rendering::XCachedPrimitive,
|
||||
css::lang::XServiceInfo > CachedPrimitiveBase_Base;
|
||||
|
||||
/** Base class, providing common functionality for implementers of
|
||||
the XCachedPrimitive interface.
|
||||
*/
|
||||
class CANVASTOOLS_DLLPUBLIC CachedPrimitiveBase:
|
||||
public cppu::BaseMutex, public CachedPrimitiveBase_Base
|
||||
public CachedPrimitiveBase_Base
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -57,7 +56,7 @@ namespace canvas
|
||||
css::uno::Reference< css::rendering::XCanvas > xTarget );
|
||||
|
||||
/// Dispose all internal references
|
||||
virtual void SAL_CALL disposing() override;
|
||||
virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
|
||||
|
||||
// XCachedPrimitive
|
||||
virtual ::sal_Int8 SAL_CALL redraw( const css::rendering::ViewState& aState ) override;
|
||||
|
@@ -42,12 +42,10 @@ namespace cairocanvas
|
||||
maRenderState(std::move( aUsedRenderState ))
|
||||
{}
|
||||
|
||||
void SAL_CALL CachedBitmap::disposing()
|
||||
void CachedBitmap::disposing(std::unique_lock<std::mutex>& rGuard)
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
|
||||
mpSurface.reset();
|
||||
CachedPrimitiveBase::disposing();
|
||||
CachedPrimitiveBase::disposing(rGuard);
|
||||
}
|
||||
|
||||
::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState,
|
||||
|
@@ -40,7 +40,7 @@ namespace cairocanvas
|
||||
const css::uno::Reference< css::rendering::XCanvas >& rTarget );
|
||||
|
||||
/// Dispose all internal references
|
||||
virtual void SAL_CALL disposing() override;
|
||||
virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
|
||||
|
||||
private:
|
||||
virtual ::sal_Int8 doRedraw( const css::rendering::ViewState& rNewState,
|
||||
|
@@ -34,7 +34,6 @@ namespace canvas
|
||||
{
|
||||
CachedPrimitiveBase::CachedPrimitiveBase( rendering::ViewState aUsedViewState,
|
||||
uno::Reference< rendering::XCanvas > xTarget ) :
|
||||
CachedPrimitiveBase_Base( m_aMutex ),
|
||||
maUsedViewState(std::move( aUsedViewState )),
|
||||
mxTarget(std::move( xTarget ))
|
||||
{
|
||||
@@ -44,10 +43,8 @@ namespace canvas
|
||||
{
|
||||
}
|
||||
|
||||
void SAL_CALL CachedPrimitiveBase::disposing()
|
||||
void CachedPrimitiveBase::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
|
||||
maUsedViewState.Clip.clear();
|
||||
mxTarget.clear();
|
||||
}
|
||||
|
@@ -48,13 +48,11 @@ namespace vclcanvas
|
||||
{
|
||||
}
|
||||
|
||||
void SAL_CALL CachedBitmap::disposing()
|
||||
void CachedBitmap::disposing(std::unique_lock<std::mutex>& rGuard)
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
|
||||
mpGraphicObject.reset();
|
||||
|
||||
CachedPrimitiveBase::disposing();
|
||||
CachedPrimitiveBase::disposing(rGuard);
|
||||
}
|
||||
|
||||
::sal_Int8 CachedBitmap::doRedraw( const rendering::ViewState& rNewState,
|
||||
|
@@ -46,7 +46,7 @@ namespace vclcanvas
|
||||
const css::uno::Reference< css::rendering::XCanvas >& rTarget );
|
||||
|
||||
/// Dispose all internal references
|
||||
virtual void SAL_CALL disposing() override;
|
||||
virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
|
||||
|
||||
private:
|
||||
virtual ::sal_Int8 doRedraw( const css::rendering::ViewState& rNewState,
|
||||
|
Reference in New Issue
Block a user