81 const ::basegfx::B2DRange& rTrueUpdateArea,
84 maTrueUpdateArea( rTrueUpdateArea ),
85 mbNeedsUpdate( bNeedsUpdate ),
110 const ::basegfx::B2DRange& rTrueUpdateArea,
114 maTrueUpdateArea( rTrueUpdateArea ),
115 mbNeedsUpdate( bNeedsUpdate ),
116 mbIsPureMove( bIsPureMove )
123 const ::basegfx::B2DRange&
getUpdateArea()
const {
return maTrueUpdateArea; }
145 const ::basegfx::B2DPoint& rOldPos,
146 const ::basegfx::B2DPoint& rNewPos,
147 const ::basegfx::B2DVector& rSpriteSize ) :
151 maUpdateArea( rNewPos.getX(),
153 rNewPos.getX() + rSpriteSize.getX(),
154 rNewPos.getY() + rSpriteSize.getY() )
159 const ::basegfx::B2DPoint& rPos,
160 const ::basegfx::B2DRange& rUpdateArea ) :
164 maUpdateArea( rUpdateArea )
198 mrManager( rManager )
204 mrManager.handleArea( mrFunc, rUpdateArea );
242 setupUpdateAreas( aUpdateAreas );
257 template<
typename Functor >
void forEachSprite(
const Functor& rFunc )
const
265 void clearChangeRecords();
271 const ::basegfx::B2DPoint& rOldPos,
272 const ::basegfx::B2DPoint& rNewPos,
273 const ::basegfx::B2DVector& rSpriteSize );
275 const ::basegfx::B2DPoint& rPos,
276 const ::basegfx::B2DRange& rUpdateArea );
285 template<
typename Functor >
void handleArea( Functor& rFunc,
290 if( !areSpritesChanged( rUpdateArea ) )
309 const ::std::size_t nNumSprites(
312 if( isAreaUpdateScroll( aMoveStart,
317 rFunc.scrollUpdate( aMoveStart,
331 aSortedUpdateSprites.push_back( rSprite );
334 ::std::sort( aSortedUpdateSprites.begin(),
335 aSortedUpdateSprites.end(),
338 if( isAreaUpdateOpaque( rUpdateArea,
342 aSortedUpdateSprites );
347 aSortedUpdateSprites );
357 void setupUpdateAreas( SpriteConnectedRanges& rUpdateAreas )
const;
359 bool areSpritesChanged(
const UpdateArea& rUpdateArea )
const;
361 bool isAreaUpdateNotOpaque( const ::basegfx::B2DRectangle& rUpdateRect,
362 const AreaComponent& rComponent )
const;
364 bool isAreaUpdateOpaque(
const UpdateArea& rUpdateArea,
365 ::std::size_t nNumSprites )
const;
382 const UpdateArea& rUpdateArea,
383 ::std::size_t nNumSprites )
const;
UnaryFunctor forEachAggregate(UnaryFunctor aFunctor) const
::std::pair< B2DRange, UserData > ComponentType
Data container for the connected components list.
Sprite::Reference mpSprite
SpriteInfo(Sprite::Reference aRef, const ::basegfx::B2DRange &rTrueUpdateArea, bool bNeedsUpdate)
Create sprite info.
const ::basegfx::B2DRange & getUpdateArea() const
const Sprite::Reference & getSprite() const
SpriteInfo(Sprite::Reference aRef, const ::basegfx::B2DRange &rTrueUpdateArea, bool bNeedsUpdate, bool bIsPureMove)
Create sprite info, specify move type.
::basegfx::B2DRange maTrueUpdateArea
This class manages smooth SpriteCanvas updates.
::std::vector< SpriteChangeRecord > VectorOfChangeRecords
void forEachSpriteArea(Functor &rFunc) const
Call given functor for each sprite area that needs an update.
VectorOfSprites maSprites
::basegfx::B2DConnectedRanges< SpriteInfo > SpriteConnectedRanges
void handleArea(Functor &rFunc, const UpdateArea &rUpdateArea) const
Internal, handles each distinct component for forEachAggregate()
SpriteRedrawManager & operator=(const SpriteRedrawManager &)=delete
SpriteConnectedRanges::ConnectedComponents UpdateArea
void forEachSprite(const Functor &rFunc) const
Call given functor for each active sprite.
SpriteRedrawManager(const SpriteRedrawManager &)=delete
SpriteConnectedRanges::ComponentType AreaComponent
::std::vector< Sprite::Reference > VectorOfSprites
VectorOfChangeRecords maChangeRecords
std::weak_ptr< cppcanvas::CustomSprite > mpSprite
Sprite::Reference mpAffectedSprite
ComponentListType maComponentList
Functor, to be used from forEachSpriteArea.
AreaUpdateCaller(Functor &rFunc, const SpriteRedrawManager &rManager)
void operator()(const UpdateArea &rUpdateArea)
const SpriteRedrawManager & mrManager
Helper struct for SpriteTracer template.
::basegfx::B2DRange maUpdateArea
::basegfx::B2DPoint maOldPos
SpriteChangeRecord(Sprite::Reference rSprite, const ::basegfx::B2DPoint &rOldPos, const ::basegfx::B2DPoint &rNewPos, const ::basegfx::B2DVector &rSpriteSize)
Sprite::Reference mpAffectedSprite
SpriteChangeRecord(Sprite::Reference rSprite, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DRange &rUpdateArea)
const Sprite::Reference & getSprite() const
Functor providing a StrictWeakOrdering for sprite references.