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

#include <cairo_spritecanvashelper.hxx>

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

Public Member Functions

 SpriteCanvasHelper ()
 
void init (::canvas::SpriteRedrawManager &rManager, SpriteCanvas &rOwningSpriteCanvas, const ::basegfx::B2ISize &rSize)
 
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::B2IRange &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 cairocanvas::CanvasHelper
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
 CanvasHelper ()
 
void disposing ()
 Release all references. More...
 
void init (const ::basegfx::B2ISize &rSizePixel, SurfaceProvider &rSurfaceProvider, css::rendering::XGraphicDevice *pDevice)
 Initialize canvas helper. More...
 
void setSize (const ::basegfx::B2ISize &rSize)
 
void setSurface (const ::cairo::SurfaceSharedPtr &pSurface, bool bHasAlpha)
 
void clear ()
 
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 ()
 
css::geometry::IntegerSize2D getSize () const
 
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)
 
css::uno::Sequence< sal_Int8getPixel (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos)
 
css::rendering::IntegerBitmapLayout getMemoryLayout ()
 
void doPolyPolygonPath (const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, Operation aOperation, bool bNoLineJoin=false, const css::uno::Sequence< css::rendering::Texture > *pTextures=nullptr) const
 
css::uno::Reference< css::rendering::XCachedPrimitive > implDrawBitmapSurface (const css::rendering::XCanvas *pCanvas, const ::cairo::SurfaceSharedPtr &pSurface, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::geometry::IntegerSize2D &rSize, bool bModulateColors, bool bHasAlpha)
 
bool repaint (const ::cairo::SurfaceSharedPtr &pSurface, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 

Private Member Functions

::cairo::SurfaceSharedPtr const & getCompositingSurface (const ::basegfx::B2ISize &rNeededSize)
 
::cairo::SurfaceSharedPtr const & getTemporarySurface ()
 
::cairo::SurfaceSharedPtr createSurface (const ::basegfx::B2ISize &rNeededSize) const
 

Private Attributes

::canvas::SpriteRedrawManagermpRedrawManager
 Set from the SpriteCanvas: instance coordinating sprite redraw. More...
 
SpriteCanvasmpOwningSpriteCanvas
 Set from the init method. used to generate sprites. More...
 
::cairo::SurfaceSharedPtr mpCompositingSurface
 a surface used to composite the frontbuffer image More...
 
::basegfx::B2ISize maCompositingSurfaceSize
 
bool mbCompositingSurfaceDirty
 
::cairo::SurfaceSharedPtr mpTemporarySurface
 a temporary surface that is guaranteed to be the same size More...
 

Additional Inherited Members

- Protected Attributes inherited from cairocanvas::CanvasHelper
SurfaceProvider * mpSurfaceProvider
 Surface provider. More...
 
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 

Detailed Description

Definition at line 40 of file cairo_spritecanvashelper.hxx.

Constructor & Destructor Documentation

◆ SpriteCanvasHelper()

cairocanvas::SpriteCanvasHelper::SpriteCanvasHelper ( )

Definition at line 91 of file cairo_spritecanvashelper.cxx.

Member Function Documentation

◆ backgroundPaint()

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

Gets called for simple background repaints.

Definition at line 228 of file cairo_spritecanvashelper.cxx.

References cairocanvas::SpriteCanvas::getBufferSurface(), mpCompositingSurface, and mpOwningSpriteCanvas.

◆ createClonedSprite()

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

◆ createCustomSprite()

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

◆ createSpriteFromAnimation()

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

◆ createSpriteFromBitmaps()

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

◆ createSurface()

cairo::SurfaceSharedPtr cairocanvas::SpriteCanvasHelper::createSurface ( const ::basegfx::B2ISize rNeededSize) const
private

◆ disposing()

void cairocanvas::SpriteCanvasHelper::disposing ( )

Dispose all internal references.

Definition at line 108 of file cairo_spritecanvashelper.cxx.

References cairocanvas::CanvasHelper::disposing(), mpCompositingSurface, mpOwningSpriteCanvas, and mpRedrawManager.

◆ genericUpdate()

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

◆ getCompositingSurface()

cairo::SurfaceSharedPtr const & cairocanvas::SpriteCanvasHelper::getCompositingSurface ( const ::basegfx::B2ISize rNeededSize)
private

◆ getTemporarySurface()

cairo::SurfaceSharedPtr const & cairocanvas::SpriteCanvasHelper::getTemporarySurface ( )
private

Definition at line 503 of file cairo_spritecanvashelper.cxx.

References createSurface(), maCompositingSurfaceSize, and mpTemporarySurface.

Referenced by scrollUpdate().

◆ init()

void cairocanvas::SpriteCanvasHelper::init ( ::canvas::SpriteRedrawManager rManager,
SpriteCanvas rOwningSpriteCanvas,
const ::basegfx::B2ISize rSize 
)

◆ opaqueUpdate()

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

◆ scrollUpdate()

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

◆ updateScreen()

bool cairocanvas::SpriteCanvasHelper::updateScreen ( const ::basegfx::B2IRange 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 147 of file cairo_spritecanvashelper.cxx.

References canvas::SpriteRedrawManager::clearChangeRecords(), cairocanvas::SpriteCanvas::flush(), canvas::SpriteRedrawManager::forEachSprite(), canvas::SpriteRedrawManager::forEachSpriteArea(), cairocanvas::SpriteCanvas::getBufferSurface(), getCompositingSurface(), cairocanvas::SpriteCanvas::getSizePixel(), cairocanvas::SpriteCanvas::getWindowSurface(), mbCompositingSurfaceDirty, mpOwningSpriteCanvas, mpRedrawManager, and SAL_INFO.

Member Data Documentation

◆ maCompositingSurfaceSize

::basegfx::B2ISize cairocanvas::SpriteCanvasHelper::maCompositingSurfaceSize
private

Definition at line 132 of file cairo_spritecanvashelper.hxx.

Referenced by getCompositingSurface(), and getTemporarySurface().

◆ mbCompositingSurfaceDirty

bool cairocanvas::SpriteCanvasHelper::mbCompositingSurfaceDirty
private

Definition at line 133 of file cairo_spritecanvashelper.hxx.

Referenced by getCompositingSurface(), and updateScreen().

◆ mpCompositingSurface

::cairo::SurfaceSharedPtr cairocanvas::SpriteCanvasHelper::mpCompositingSurface
private

a surface used to composite the frontbuffer image

Definition at line 131 of file cairo_spritecanvashelper.hxx.

Referenced by backgroundPaint(), disposing(), and getCompositingSurface().

◆ mpOwningSpriteCanvas

SpriteCanvas* cairocanvas::SpriteCanvasHelper::mpOwningSpriteCanvas
private

Set from the init method. used to generate sprites.

Definition at line 128 of file cairo_spritecanvashelper.hxx.

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

◆ mpRedrawManager

::canvas::SpriteRedrawManager* cairocanvas::SpriteCanvasHelper::mpRedrawManager
private

Set from the SpriteCanvas: instance coordinating sprite redraw.

Definition at line 125 of file cairo_spritecanvashelper.hxx.

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

◆ mpTemporarySurface

::cairo::SurfaceSharedPtr cairocanvas::SpriteCanvasHelper::mpTemporarySurface
private

a temporary surface that is guaranteed to be the same size

Definition at line 136 of file cairo_spritecanvashelper.hxx.

Referenced by getCompositingSurface(), and getTemporarySurface().


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