22#include <com/sun/star/rendering/XCanvas.hpp>
23#include <com/sun/star/rendering/RepaintResult.hpp>
36 const ::Point& rPoint,
39 const rendering::ViewState& rUsedViewState,
40 rendering::RenderState aUsedRenderState,
41 const uno::Reference< rendering::XCanvas >& rTarget ) :
42 CachedPrimitiveBase( rUsedViewState,
rTarget ),
43 mpGraphicObject(
std::move( xGraphicObject )),
44 maRenderState(
std::move(aUsedRenderState)),
51 void CachedBitmap::disposing(std::unique_lock<std::mutex>& rGuard)
53 mpGraphicObject.reset();
55 CachedPrimitiveBase::disposing(rGuard);
58 ::sal_Int8 CachedBitmap::doRedraw(
const rendering::ViewState& rNewState,
59 const rendering::ViewState& rOldState,
60 const uno::Reference< rendering::XCanvas >& rTargetCanvas,
61 bool bSameViewTransform )
64 "CachedBitmap::doRedraw(): base called with changed view transform "
65 "(told otherwise during construction)" );
68 if( rNewState.Clip != rOldState.Clip )
69 return rendering::RepaintResult::FAILED;
71 RepaintTarget* pTarget =
dynamic_cast< RepaintTarget*
>(rTargetCanvas.get());
74 "CachedBitmap::redraw(): cannot cast target to RepaintTarget" );
76 if( !pTarget->repaint( mpGraphicObject,
84 return rendering::RepaintResult::FAILED;
87 return rendering::RepaintResult::REDRAWN;
CachedBitmap(GraphicObjectSharedPtr xGraphicObject, const ::Point &rPoint, const ::Size &rSize, const GraphicAttr &rAttr, const css::rendering::ViewState &rUsedViewState, css::rendering::RenderState aUsedRenderState, const css::uno::Reference< css::rendering::XCanvas > &rTarget)
Create an XCachedPrimitive for given GraphicObject.
#define ENSURE_OR_THROW(c, m)
::basegfx::B2ISize maSize
std::shared_ptr< GraphicObject > GraphicObjectSharedPtr