28#include <rtl/math.hxx>
45 mbShowSpriteBounds(false)
50 const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
53 bool bShowSpriteBounds )
56 "SpriteHelper::init(): Invalid sprite canvas or back buffer" );
62 init( rSpriteSize, rOwningSpriteCanvas );
71 CanvasCustomSpriteHelper::disposing();
75 const ::basegfx::B2DPoint& rPos,
76 bool& io_bSurfacesDirty,
86 SAL_INFO(
"canvas.vcl",
"SpriteHelper::redraw(): output pos is (" <<
87 rPos.getX() <<
"," << rPos.getY() <<
")");
91 if( !
isActive() || ::basegfx::fTools::equalZero( fAlpha ) )
94 const ::basegfx::B2DVector& rOrigOutputSize(
getSizePixel() );
109 const bool bNeedBitmapUpdate( io_bSurfacesDirty ||
115 io_bSurfacesDirty =
false;
118 if( bNeedBitmapUpdate )
120 const Point aEmptyPoint;
154 ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(
157 if( aClipPoly.
count() )
161 aClipTransform.
translate( aOutPos.
X(), aOutPos.
Y() );
180 aMoveTransform.
translate( aOutPos.
X(), aOutPos.
Y() );
181 aTransform = aMoveTransform * aTransform * aSizeTransform;
185 rTargetSurface.
Pop();
194 aOutPos.
X() + aOutputSize.
Width()-1,
195 aOutPos.
Y() + aOutputSize.
Height()-1) ) );
201 for(
int i=0;
i<aMarkerPoly.
Count(); ++
i )
213 rTargetSurface.
SetFont( aVCLFont );
216 rtl_math_StringFormat_F,
217 2,
'.',
nullptr,
' ') );
221 "sprite " <<
this <<
" has prio " <<
getPriority());
226 return ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( xPoly );
Bitmap GetBitmap(Color aTransparentReplaceColor) const
void DrawTransformedBitmapEx(const basegfx::B2DHomMatrix &rTransformation, const BitmapEx &rBitmapEx, double fAlpha=1.0)
void DrawPolyLine(const tools::Polygon &rPoly)
void SetFont(const vcl::Font &rNewFont)
void SetTextAlign(TextAlign eAlign)
void SetTextColor(const Color &rColor)
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void DrawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void translate(double fX, double fY)
void scale(double fX, double fY)
void transform(const basegfx::B2DHomMatrix &rMatrix)
bool isContentFullyOpaque() const
Returns true, if sprite content bitmap is fully opaque.
void transformUpdated() const
Notifies that caller is again in sync with current transformation.
double getPriority() const
const css::uno::Reference< css::rendering::XPolyPolygon2D > & getClip() const
Retrieve current clip.
bool isActive() const
Retrieve current activation state.
const ::basegfx::B2DHomMatrix & getTransformation() const
bool hasTransformChanged() const
Returns true, if transformation has changed since last transformUpdated() call.
double getAlpha() const
Retrieve current alpha value.
const ::basegfx::B2DVector & getSizePixel() const
void SetColor(const Color &)
void SetFontHeight(tools::Long nHeight)
void init(const css::geometry::RealSize2D &rSpriteSize, const ::canvas::SpriteSurface::Reference &rOwningSpriteCanvas, const BackBufferSharedPtr &rBackBuffer, const BackBufferSharedPtr &rBackBufferMask, bool bShowSpriteBounds)
Late-init the sprite helper.
void redraw(OutputDevice &rOutDev, const ::basegfx::B2DPoint &rPos, bool &bSurfacesDirty, bool bBufferedUpdate) const
Repaint sprite content to associated sprite canvas.
mutable ::canvas::vcltools::VCLObject< BitmapEx > maContent
Cached bitmap for the current sprite content.
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override
Called to convert an API polygon to a basegfx polygon.
BackBufferSharedPtr mpBackBuffer
bool mbShowSpriteBounds
When true, line sprite corners in red.
BackBufferSharedPtr mpBackBufferMask
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
#define ENSURE_OR_THROW(c, m)
#define SAL_INFO(area, stream)
std::shared_ptr< BackBuffer > BackBufferSharedPtr