24#include <com/sun/star/rendering/RepaintResult.hpp>
36 uno::Reference< rendering::XCanvas > xTarget ) :
37 maUsedViewState(
std::move( aUsedViewState )),
42 CachedPrimitiveBase::~CachedPrimitiveBase()
46 void CachedPrimitiveBase::disposing(std::unique_lock<std::mutex>& )
48 maUsedViewState.Clip.clear();
52 sal_Int8 SAL_CALL CachedPrimitiveBase::redraw(
const rendering::ViewState& aState )
57 ::basegfx::unotools::homMatrixFromAffineMatrix( aUsedTransformation,
58 maUsedViewState.AffineTransform );
59 ::basegfx::unotools::homMatrixFromAffineMatrix( aNewTransformation,
60 aState.AffineTransform );
62 const bool bSameViewTransforms( aUsedTransformation == aNewTransformation );
64 if( !bSameViewTransforms )
68 return rendering::RepaintResult::FAILED;
71 return doRedraw( aState,
74 bSameViewTransforms );
77 OUString SAL_CALL CachedPrimitiveBase::getImplementationName( )
79 return "canvas::CachedPrimitiveBase";
82 sal_Bool SAL_CALL CachedPrimitiveBase::supportsService(
const OUString& ServiceName )
87 uno::Sequence< OUString > SAL_CALL CachedPrimitiveBase::getSupportedServiceNames( )
89 return {
"com.sun.star.rendering.CachedBitmap" };
CachedPrimitiveBase(css::rendering::ViewState rUsedViewState, css::uno::Reference< css::rendering::XCanvas > xTarget)
Create an XCachedPrimitive for given target canvas.
Reference< XInterface > xTarget
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)