LibreOffice Module canvas (master) 1
Public Member Functions | Private Attributes | List of all members
dxcanvas::SpriteCanvasHelper Class Reference

#include <dx_spritecanvashelper.hxx>

Inheritance diagram for dxcanvas::SpriteCanvasHelper:
[legend]
Collaboration diagram for dxcanvas::SpriteCanvasHelper:
[legend]

Public Member Functions

 SpriteCanvasHelper ()
 
void init (SpriteCanvas &rParent, ::canvas::SpriteRedrawManager &rManager, const IDXRenderModuleSharedPtr &rRenderModule, const std::shared_ptr< canvas::ISurfaceProxyManager > &rSurfaceProxy, const DXSurfaceBitmapSharedPtr &rBackBuffer, const ::basegfx::B2ISize &rOutputOffset)
 
void disposing ()
 Dispose all internal references. More...
 
css::uno::Reference< css::rendering::XAnimatedSprite > createSpriteFromAnimation (const css::uno::Reference< css::rendering::XAnimation > &animation)
 
css::uno::Reference< css::rendering::XAnimatedSprite > createSpriteFromBitmaps (const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > &animationBitmaps, sal_Int8 interpolationMode)
 
css::uno::Reference< css::rendering::XCustomSprite > createCustomSprite (const css::geometry::RealSize2D &spriteSize)
 
css::uno::Reference< css::rendering::XSprite > createClonedSprite (const css::uno::Reference< css::rendering::XSprite > &original)
 
bool updateScreen (const ::basegfx::B2IRectangle &rCurrArea, bool bUpdateAll, bool &io_bSurfaceDirty)
 Actually perform the screen update. More...
 
void backgroundPaint (const ::basegfx::B2DRange &rUpdateRect)
 Gets called for simple background repaints. More...
 
void scrollUpdate (const ::basegfx::B2DRange &rMoveStart, const ::basegfx::B2DRange &rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea &rUpdateArea)
 Gets called when area can be handled by scrolling. More...
 
void opaqueUpdate (const ::basegfx::B2DRange &rTotalArea, const std::vector< ::canvas::Sprite::Reference > &rSortedUpdateSprites)
 
void genericUpdate (const ::basegfx::B2DRange &rTotalArea, const std::vector< ::canvas::Sprite::Reference > &rSortedUpdateSprites)
 
- Public Member Functions inherited from dxcanvas::BitmapCanvasHelper
 BitmapCanvasHelper ()
 
void disposing ()
 Release all references. More...
 
void setTarget (const IBitmapSharedPtr &rTarget)
 Set the target for rendering operations. More...
 
void setTarget (const IBitmapSharedPtr &rTarget, const ::basegfx::B2ISize &rOutputOffset)
 Set the target for rendering operations. More...
 
void clear ()
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawTextLayout (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XTextLayout > &laidOutText, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
void copyRect (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmapCanvas > &sourceCanvas, const css::geometry::RealRectangle2D &sourceRect, const css::rendering::ViewState &sourceViewState, const css::rendering::RenderState &sourceRenderState, const css::geometry::RealRectangle2D &destRect, const css::rendering::ViewState &destViewState, const css::rendering::RenderState &destRenderState)
 
css::geometry::IntegerSize2D getSize ()
 
css::uno::Reference< css::rendering::XBitmap > getScaledBitmap (const css::geometry::RealSize2D &newSize, bool beFast)
 
css::uno::Sequence< sal_Int8getData (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
 
void setData (const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
 
void setPixel (const css::uno::Sequence< sal_Int8 > &color, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::uno::Sequence< sal_Int8getPixel (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::uno::Reference< css::rendering::XBitmapPalette > getPalette ()
 
css::rendering::IntegerBitmapLayout getMemoryLayout ()
 
bool hasAlpha () const
 
- Public Member Functions inherited from dxcanvas::CanvasHelper
 CanvasHelper ()
 
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
void disposing ()
 Release all references. More...
 
void setDevice (css::rendering::XGraphicDevice &rDevice)
 Initialize canvas helper. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget)
 Set the target for rendering operations. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget, const ::basegfx::B2ISize &rOutputOffset)
 Set the target for rendering operations. More...
 
void clear ()
 
void drawPoint (const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
void drawLine (const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aStartPoint, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
void drawBezier (const css::rendering::XCanvas *pCanvas, const css::geometry::RealBezierSegment2D &aBezierSegment, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokePolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTexturedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTextureMappedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XPolyPolygon2D > queryStrokeShapes (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillTexturedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures)
 
css::uno::Reference< css::rendering::XCachedPrimitive > fillTextureMappedPolyPolygon (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping)
 
css::uno::Reference< css::rendering::XCanvasFont > createFont (const css::rendering::XCanvas *pCanvas, const css::rendering::FontRequest &fontRequest, const css::uno::Sequence< css::beans::PropertyValue > &extraFontProperties, const css::geometry::Matrix2D &fontMatrix)
 
css::uno::Sequence< css::rendering::FontInfo > queryAvailableFonts (const css::rendering::XCanvas *pCanvas, const css::rendering::FontInfo &aFilter, const css::uno::Sequence< css::beans::PropertyValue > &aFontProperties)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawText (const css::rendering::XCanvas *pCanvas, const css::rendering::StringContext &text, const css::uno::Reference< css::rendering::XCanvasFont > &xFont, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, sal_Int8 textDirection)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawTextLayout (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XTextLayout > &laidOutText, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawBitmap (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawBitmapModulated (const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
css::uno::Reference< css::rendering::XGraphicDevice > getDevice ()
 
void flush () const
 
void modifying ()
 Called from XCanvas base classes, to notify that content is about to change. More...
 

Private Attributes

SpriteCanvasmpSpriteSurface
 For generating sprites. More...
 
::canvas::SpriteRedrawManagermpRedrawManager
 Set from the SpriteCanvas: instance coordinating sprite redraw. More...
 
IDXRenderModuleSharedPtr mpRenderModule
 DX device, handling all low-level rendering. More...
 
std::shared_ptr< canvas::ISurfaceProxyManagermpSurfaceProxy
 
DXSurfaceBitmapSharedPtr mpBackBuffer
 Backbuffer, contains the static canvas render output. More...
 
mutable::basegfx::B2IRange maUpdateRect
 Completely temporary rect storage (used by sprite repaint) More...
 
mutable::basegfx::B2IRange maScrapRect
 Completely temporary rect storage (used by sprite repaint) More...
 
bool mbShowSpriteBounds
 When true, show small bound rects around each sprite. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dxcanvas::CanvasHelper
bool needOutput () const
 
void setupGraphicsState (GraphicsSharedPtr const &rGraphics, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
Gdiplus::CompositingMode calcCompositingMode (sal_Int8 nMode)
 
- Protected Attributes inherited from dxcanvas::BitmapCanvasHelper
IBitmapSharedPtr mpTarget
 Render target. More...
 
- Protected Attributes inherited from dxcanvas::CanvasHelper
GDIPlusUserSharedPtr mpGdiPlusUser
 Refcounted global GDI+ state container. More...
 
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
GraphicsProviderSharedPtr mpGraphicsProvider
 Provides the Gdiplus::Graphics to render into. More...
 
::basegfx::B2ISize maOutputOffset
 Current (transformation-independent) output buffer offset. More...
 

Detailed Description

Definition at line 40 of file dx_spritecanvashelper.hxx.

Constructor & Destructor Documentation

◆ SpriteCanvasHelper()

dxcanvas::SpriteCanvasHelper::SpriteCanvasHelper ( )

Definition at line 63 of file dx_spritecanvashelper.cxx.

References mbShowSpriteBounds.

Member Function Documentation

◆ backgroundPaint()

void dxcanvas::SpriteCanvasHelper::backgroundPaint ( const ::basegfx::B2DRange rUpdateRect)

Gets called for simple background repaints.

Definition at line 219 of file dx_spritecanvashelper.cxx.

References ENSURE_OR_THROW, maScrapRect, mpBackBuffer, and mpRenderModule.

◆ createClonedSprite()

css::uno::Reference< css::rendering::XSprite > dxcanvas::SpriteCanvasHelper::createClonedSprite ( const css::uno::Reference< css::rendering::XSprite > &  original)

◆ createCustomSprite()

css::uno::Reference< css::rendering::XCustomSprite > dxcanvas::SpriteCanvasHelper::createCustomSprite ( const css::geometry::RealSize2D &  spriteSize)

◆ createSpriteFromAnimation()

css::uno::Reference< css::rendering::XAnimatedSprite > dxcanvas::SpriteCanvasHelper::createSpriteFromAnimation ( const css::uno::Reference< css::rendering::XAnimation > &  animation)

◆ createSpriteFromBitmaps()

css::uno::Reference< css::rendering::XAnimatedSprite > dxcanvas::SpriteCanvasHelper::createSpriteFromBitmaps ( const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > &  animationBitmaps,
sal_Int8  interpolationMode 
)

◆ disposing()

void dxcanvas::SpriteCanvasHelper::disposing ( )

Dispose all internal references.

Definition at line 97 of file dx_spritecanvashelper.cxx.

References dxcanvas::CanvasHelper::disposing(), mpBackBuffer, mpRedrawManager, mpRenderModule, and mpSpriteSurface.

◆ genericUpdate()

void dxcanvas::SpriteCanvasHelper::genericUpdate ( const ::basegfx::B2DRange rTotalArea,
const std::vector< ::canvas::Sprite::Reference > &  rSortedUpdateSprites 
)

◆ init()

void dxcanvas::SpriteCanvasHelper::init ( SpriteCanvas rParent,
::canvas::SpriteRedrawManager rManager,
const IDXRenderModuleSharedPtr rRenderModule,
const std::shared_ptr< canvas::ISurfaceProxyManager > &  rSurfaceProxy,
const DXSurfaceBitmapSharedPtr rBackBuffer,
const ::basegfx::B2ISize rOutputOffset 
)

◆ opaqueUpdate()

void dxcanvas::SpriteCanvasHelper::opaqueUpdate ( const ::basegfx::B2DRange rTotalArea,
const std::vector< ::canvas::Sprite::Reference > &  rSortedUpdateSprites 
)

◆ scrollUpdate()

void dxcanvas::SpriteCanvasHelper::scrollUpdate ( const ::basegfx::B2DRange rMoveStart,
const ::basegfx::B2DRange rMoveEnd,
const ::canvas::SpriteRedrawManager::UpdateArea rUpdateArea 
)

Gets called when area can be handled by scrolling.

Called method must copy screen content from rMoveStart to rMoveEnd, and restore the background in the uncovered areas.

Parameters
rMoveStartSource rect of the scroll
rMoveEndDest rect of the scroll
rUpdateAreaAll info necessary, should rMoveStart be partially or fully outside the outdev

Definition at line 230 of file dx_spritecanvashelper.cxx.

References ENSURE_OR_THROW, fround(), basegfx::Range2D< typename TYPE, typename TRAITS >::intersect(), maScrapRect, maUpdateRect, mpBackBuffer, mpRenderModule, and canvas::tools::spritePixelAreaFromB2DRange().

◆ updateScreen()

bool dxcanvas::SpriteCanvasHelper::updateScreen ( const ::basegfx::B2IRectangle rCurrArea,
bool  bUpdateAll,
bool &  io_bSurfaceDirty 
)

Actually perform the screen update.

Parameters
rCurrAreaCurrent window area in absolute screen coordinates
bUpdateAllsal_True, if everything must be updated, not only changed sprites
io_bSurfaceDirtyIn/out parameter, whether backbuffer surface is dirty (if yes, we're performing a full update, anyway)

Definition at line 142 of file dx_spritecanvashelper.cxx.

References canvas::SpriteRedrawManager::clearChangeRecords(), canvas::SpriteRedrawManager::forEachSprite(), canvas::SpriteRedrawManager::forEachSpriteArea(), maScrapRect, maUpdateRect, mpBackBuffer, mpRedrawManager, and mpRenderModule.

Member Data Documentation

◆ maScrapRect

mutable::basegfx::B2IRange dxcanvas::SpriteCanvasHelper::maScrapRect
private

Completely temporary rect storage (used by sprite repaint)

Definition at line 145 of file dx_spritecanvashelper.hxx.

Referenced by backgroundPaint(), genericUpdate(), opaqueUpdate(), scrollUpdate(), and updateScreen().

◆ maUpdateRect

mutable::basegfx::B2IRange dxcanvas::SpriteCanvasHelper::maUpdateRect
private

Completely temporary rect storage (used by sprite repaint)

Definition at line 142 of file dx_spritecanvashelper.hxx.

Referenced by genericUpdate(), opaqueUpdate(), scrollUpdate(), and updateScreen().

◆ mbShowSpriteBounds

bool dxcanvas::SpriteCanvasHelper::mbShowSpriteBounds
private

When true, show small bound rects around each sprite.

Definition at line 148 of file dx_spritecanvashelper.hxx.

Referenced by SpriteCanvasHelper().

◆ mpBackBuffer

DXSurfaceBitmapSharedPtr dxcanvas::SpriteCanvasHelper::mpBackBuffer
private

Backbuffer, contains the static canvas render output.

Definition at line 139 of file dx_spritecanvashelper.hxx.

Referenced by backgroundPaint(), disposing(), genericUpdate(), init(), opaqueUpdate(), scrollUpdate(), and updateScreen().

◆ mpRedrawManager

::canvas::SpriteRedrawManager* dxcanvas::SpriteCanvasHelper::mpRedrawManager
private

Set from the SpriteCanvas: instance coordinating sprite redraw.

Definition at line 131 of file dx_spritecanvashelper.hxx.

Referenced by disposing(), init(), and updateScreen().

◆ mpRenderModule

IDXRenderModuleSharedPtr dxcanvas::SpriteCanvasHelper::mpRenderModule
private

DX device, handling all low-level rendering.

Definition at line 134 of file dx_spritecanvashelper.hxx.

Referenced by backgroundPaint(), disposing(), genericUpdate(), init(), opaqueUpdate(), scrollUpdate(), and updateScreen().

◆ mpSpriteSurface

SpriteCanvas* dxcanvas::SpriteCanvasHelper::mpSpriteSurface
private

For generating sprites.

Definition at line 128 of file dx_spritecanvashelper.hxx.

Referenced by disposing(), and init().

◆ mpSurfaceProxy

std::shared_ptr<canvas::ISurfaceProxyManager> dxcanvas::SpriteCanvasHelper::mpSurfaceProxy
private

Definition at line 136 of file dx_spritecanvashelper.hxx.

Referenced by init().


The documentation for this class was generated from the following files: