31#include <rtl/math.hxx>
47 mbTextureDirty( true ),
48 mbShowSpriteBounds( false )
56 bool bShowSpriteBounds )
61 "SpriteHelper::init(): Invalid device, sprite canvas or surface" );
69 CanvasCustomSpriteHelper::init( rSpriteSize,
79 CanvasCustomSpriteHelper::disposing();
96 ::basegfx::fTools::equalZero(
getAlpha() ) )
116 !::basegfx::fTools::equalZero( fAlpha ) )
124 SAL_INFO(
"canvas.directx",
"SpriteHelper::redraw(): output pos is (" <<
125 rPos.getX() <<
"," << rPos.getY() <<
")" );
129 const uno::Reference< rendering::XPolyPolygon2D >& xClip(
getClip() );
132 io_bSurfaceDirty =
false;
135 bool bIsClipRectangular(
false );
146 const sal_Int32 nNumClipPolygons( aClipPath.
count() );
147 if( nNumClipPolygons )
153 if( nNumClipPolygons == 1 )
155 bIsClipRectangular =
true;
159 const ::basegfx::B2DRectangle aSourceRect( 0.0,
165 if( !aClipPath.
count() )
167 mpBitmap->draw(fAlpha,rPos,rTransform);
169 else if( bIsClipRectangular )
175 ::basegfx::utils::getRange( aClipPath ) );
178 mpBitmap->draw(fAlpha,rPos,aClipBounds,rTransform);
185 mpBitmap->draw(fAlpha,rPos,aClipPath,rTransform);
190 if( aClipPath.
count() )
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
void intersect(const Range2D &rRange)
const css::uno::Reference< css::rendering::XPolyPolygon2D > & getClip() const
Retrieve current clip.
bool isActive() const
Retrieve current activation state.
const ::basegfx::B2DHomMatrix & getTransformation() const
const ::basegfx::B2DPoint & getPosPixel() const
double getAlpha() const
Retrieve current alpha value.
const ::basegfx::B2DVector & getSizePixel() const
bool needRedraw() const
Returns true, if the sprite really needs redraw.
void redraw(bool &io_bSurfaceDirty) const
Repaint sprite content via hardware to associated sprite canvas.
SpriteCanvasRef mpSpriteCanvas
DXSurfaceBitmapSharedPtr mpBitmap
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override
Called to convert an API polygon to a basegfx polygon.
SpriteHelper()
Create sprite helper.
void init(const css::geometry::RealSize2D &rSpriteSize, const SpriteCanvasRef &rSpriteCanvas, const IDXRenderModuleSharedPtr &rRenderModule, const DXSurfaceBitmapSharedPtr &rBitmap, bool bShowSpriteBounds)
Late-init the sprite helper.
#define ENSURE_OR_THROW(c, m)
#define SAL_INFO(area, stream)
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr
const cppcanvas::SpriteCanvasSharedPtr mpSpriteCanvas