22#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
23#include <com/sun/star/geometry/RealSize2D.hpp>
24#include <com/sun/star/rendering/XBitmap.hpp>
25#include <com/sun/star/geometry/IntegerSize2D.hpp>
32#include <rtl/math.hxx>
53 const sal_Int32 nNumClipPolygons(
mxClipPoly->getNumberOfPolygons() );
64 const ::basegfx::B2DRectangle& rClipBounds(
65 ::basegfx::utils::getRange( aClipPath ) );
67 const ::basegfx::B2DRectangle aBounds( 0.0, 0.0,
81 aClipBoundsA.
intersect( aSpriteRectPixel );
83 if( nNumClipPolygons != 1 )
94 const bool bNewClipIsRect(
99 const bool bUseOptimizedUpdate( bNewClipIsRect &&
109 bUseOptimizedUpdate )
113 std::vector< ::basegfx::B2DRectangle > aClipDifferences;
117 ::basegfx::computeSetDifference(aClipDifferences,
128 for(
const auto& rClipDiff : aClipDifferences )
152 mbIsCurrClipRectangle(true),
153 mbIsContentFullyOpaque( false ),
154 mbTransformDirty( true )
162 "CanvasCustomSpriteHelper::init(): Invalid owning sprite canvas" );
166 ceil( rSpriteSize.Width ) ) );
170 ceil( rSpriteSize.Height ) ) );
185 const uno::Reference< rendering::XBitmap >& xBitmap,
186 const rendering::ViewState& viewState,
187 const rendering::RenderState& renderState )
191 if( xBitmap->hasAlpha() )
194 const geometry::IntegerSize2D& rInputSize(xBitmap->getSize());
195 basegfx::B2DSize rOurSize(rSprite->getSizePixel().getX(), rSprite->getSizePixel().getY());
235 const geometry::RealPoint2D& aNewPos,
236 const rendering::ViewState& viewState,
237 const rendering::RenderState& renderState )
249 ::basegfx::unotools::b2DPointFromRealPoint2D(aNewPos) );
250 aPoint *= aTransform;
255 const ::basegfx::B2DRectangle& rBounds
263 rBounds.getMinimum(),
265 rBounds.getRange() );
272 const geometry::AffineMatrix2D& aTransformation )
275 ::basegfx::unotools::homMatrixFromAffineMatrix(aMatrix,
282 const ::basegfx::B2DRectangle& rPrevBounds(
getUpdateArea() );
301 const uno::Reference< rendering::XPolyPolygon2D >& xClip )
306 const ::basegfx::B2DRectangle& rPrevBounds(
getUpdateArea() );
389 !::rtl::math::approxEqual(
mfAlpha, 1.0) )
433 return ::basegfx::B2DRectangle(
void translate(double fX, double fY)
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void transform(const basegfx::B2DHomMatrix &rMatrix)
B2DPoint getMaximum() const
B2DPoint getMinimum() const
void intersect(const Range2D &rRange)
bool isInside(const Tuple2D< TYPE > &rTuple) const
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const =0
Called to convert an API polygon to a basegfx polygon.
void clip(const Sprite::Reference &rSprite, const css::uno::Reference< css::rendering::XPolyPolygon2D > &aClip)
CanvasCustomSpriteHelper()
void init(const css::geometry::RealSize2D &rSpriteSize, const SpriteSurface::Reference &rOwningSpriteCanvas)
Init helper.
::basegfx::B2DRange getUpdateArea() const
bool isAreaUpdateOpaque(const ::basegfx::B2DRange &rUpdateArea) const
SpriteSurface::Reference mpSpriteCanvas
Owning sprite canvas.
void transform(const Sprite::Reference &rSprite, const css::geometry::AffineMatrix2D &aTransformation)
void hide(const Sprite::Reference &rSprite)
bool mbTransformDirty
True, iff maTransform has changed.
void show(const Sprite::Reference &rSprite)
bool mbIsContentFullyOpaque
Redraw speedup.
void setAlpha(const Sprite::Reference &rSprite, double alpha)
void move(const Sprite::Reference &rSprite, const css::geometry::RealPoint2D &aNewPos, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
bool updateClipState(const Sprite::Reference &rSprite)
Update clip information from current state.
bool mbIsCurrClipRectangle
If true, denotes that the current sprite clip is a true rectangle, i.e.
void checkDrawBitmap(const Sprite::Reference &rSprite, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
need to call this method for XCanvas::drawBitmap(), for opacity tracking
css::uno::Reference< css::rendering::XPolyPolygon2D > mxClipPoly
void disposing()
Object is being disposed, release all internal references.
::basegfx::B2DHomMatrix maTransform
::basegfx::B2DVector maSize
::basegfx::B2DPoint maPosition
::basegfx::B2DRange maCurrClipBounds
Currently active clip area.
void setPriority(const Sprite::Reference &rSprite, double nPriority)
void clearingContent(const Sprite::Reference &rSprite)
need to call this method for XCanvas::clear(), for opacity tracking
#define ENSURE_OR_THROW(c, m)
constexpr double alpha[nDetails]