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

#include <spritecanvashelper.hxx>

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

Public Member Functions

 SpriteCanvasHelper ()
 
 ~SpriteCanvasHelper ()
 
void init (const OutDevProviderSharedPtr &rOutDev, SpriteCanvas &rOwningSpriteCanvas, ::canvas::SpriteRedrawManager &rManager, bool bProtect, bool bHaveAlpha)
 
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 (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)
 
css::uno::Any isUnsafeScrolling () const
 
void enableUnsafeScrolling (const css::uno::Any &rAny)
 
css::uno::Any isSpriteBounds () const
 
void enableSpriteBounds (const css::uno::Any &rAny)
 
- Public Member Functions inherited from vclcanvas::CanvasHelper
 CanvasHelper ()
 Create canvas helper. More...
 
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
void disposing ()
 Release all references. More...
 
void init (css::rendering::XGraphicDevice &rDevice, const OutDevProviderSharedPtr &rOutDev, bool bProtect, bool bHaveAlpha)
 Initialize canvas helper. More...
 
void setOutDev (const OutDevProviderSharedPtr &rOutDev, bool bProtect)
 Set primary output device. More...
 
void setBackgroundOutDev (const OutDevProviderSharedPtr &rOutDev)
 Set secondary output device. More...
 
void clear ()
 
void drawLine (const css::rendering::XCanvas *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, const css::rendering::FontInfo &aFilter, const css::uno::Sequence< css::beans::PropertyValue > &aFontProperties)
 
css::uno::Reference< css::rendering::XCachedPrimitive > drawText (const css::rendering::XCanvas *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 *rCanvas, 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 ()
 
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 ()
 
bool repaint (const GraphicObjectSharedPtr &rGrf, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const ::Point &rPt, const ::Size &rSz, const GraphicAttr &rAttr) const
 Repaint a cached bitmap. More...
 
void flush () const
 Flush drawing queue. More...
 
int setupOutDevState (const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, ColorType eColorType) const
 
bool hasAlpha () const
 

Private Member Functions

void renderFrameCounter (OutputDevice &rOutDev)
 
void renderSpriteCount (OutputDevice &rOutDev)
 
void renderMemUsage (OutputDevice &rOutDev)
 

Private Attributes

::canvas::SpriteRedrawManagermpRedrawManager
 Set from the SpriteCanvas: instance coordinating sprite redraw. More...
 
SpriteCanvasmpOwningSpriteCanvas
 Set from the init method. used to generate sprites. More...
 
VclPtr< VirtualDevicemaVDev
 Background compositing surface. More...
 
::canvas::tools::ElapsedTime maLastUpdate
 For the frame counter timings. More...
 
bool mbShowFrameInfo
 When true, canvas displays debug info on each frame. More...
 
bool mbShowSpriteBounds
 When true, canvas creates all new sprites with red lines in the corners. More...
 
bool mbIsUnsafeScrolling
 When true, canvas uses the scroll optimization (direct scrolls in front buffer) More...
 

Additional Inherited Members

- Public Types inherited from vclcanvas::CanvasHelper
enum  ColorType {
  LINE_COLOR ,
  FILL_COLOR ,
  TEXT_COLOR ,
  IGNORE_COLOR
}
 
- Protected Attributes inherited from vclcanvas::CanvasHelper
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
OutDevProviderSharedPtr mpProtectedOutDevProvider
 Rendering to this outdev preserves its state. More...
 
OutDevProviderSharedPtr mpOutDevProvider
 Rendering to this outdev does not preserve its state. More...
 
OutDevProviderSharedPtr mp2ndOutDevProvider
 Rendering to this outdev does not preserve its state. More...
 
bool mbHaveAlpha
 When true, content is able to represent alpha. More...
 

Detailed Description

Definition at line 38 of file spritecanvashelper.hxx.

Constructor & Destructor Documentation

◆ SpriteCanvasHelper()

vclcanvas::SpriteCanvasHelper::SpriteCanvasHelper ( )

Definition at line 119 of file spritecanvashelper.cxx.

References Create(), mbShowFrameInfo, and mbShowSpriteBounds.

◆ ~SpriteCanvasHelper()

vclcanvas::SpriteCanvasHelper::~SpriteCanvasHelper ( )

Member Function Documentation

◆ backgroundPaint()

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

Gets called for simple background repaints.

Definition at line 317 of file spritecanvashelper.cxx.

References ENSURE_OR_THROW, vclcanvas::SpriteCanvas::getBackBuffer(), vclcanvas::SpriteCanvas::getFrontBuffer(), and mpOwningSpriteCanvas.

◆ createClonedSprite()

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

◆ createCustomSprite()

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

◆ createSpriteFromAnimation()

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

◆ createSpriteFromBitmaps()

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

◆ disposing()

void vclcanvas::SpriteCanvasHelper::disposing ( )

Dispose all internal references.

Definition at line 154 of file spritecanvashelper.cxx.

References vclcanvas::CanvasHelper::disposing(), mpOwningSpriteCanvas, and mpRedrawManager.

◆ enableSpriteBounds()

void vclcanvas::SpriteCanvasHelper::enableSpriteBounds ( const css::uno::Any &  rAny)
inline

Definition at line 132 of file spritecanvashelper.hxx.

References mbShowSpriteBounds.

◆ enableUnsafeScrolling()

void vclcanvas::SpriteCanvasHelper::enableUnsafeScrolling ( const css::uno::Any &  rAny)
inline

Definition at line 123 of file spritecanvashelper.hxx.

References mbIsUnsafeScrolling.

◆ genericUpdate()

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

◆ init()

void vclcanvas::SpriteCanvasHelper::init ( const OutDevProviderSharedPtr rOutDev,
SpriteCanvas rOwningSpriteCanvas,
::canvas::SpriteRedrawManager rManager,
bool  bProtect,
bool  bHaveAlpha 
)

◆ isSpriteBounds()

css::uno::Any vclcanvas::SpriteCanvasHelper::isSpriteBounds ( ) const
inline

Definition at line 128 of file spritecanvashelper.hxx.

References mbShowSpriteBounds.

◆ isUnsafeScrolling()

css::uno::Any vclcanvas::SpriteCanvasHelper::isUnsafeScrolling ( ) const
inline

Definition at line 119 of file spritecanvashelper.hxx.

References mbIsUnsafeScrolling.

◆ opaqueUpdate()

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

◆ renderFrameCounter()

void vclcanvas::SpriteCanvasHelper::renderFrameCounter ( OutputDevice rOutDev)
private

◆ renderMemUsage()

void vclcanvas::SpriteCanvasHelper::renderMemUsage ( OutputDevice rOutDev)
private

◆ renderSpriteCount()

void vclcanvas::SpriteCanvasHelper::renderSpriteCount ( OutputDevice rOutDev)
private

◆ scrollUpdate()

void vclcanvas::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 331 of file spritecanvashelper.cxx.

References vcl::CLIPREGION, canvas::tools::clipScrollArea(), OutputDevice::CopyArea(), ENSURE_OR_THROW, vclcanvas::SpriteCanvas::getBackBuffer(), vclcanvas::SpriteCanvas::getFrontBuffer(), basegfx::B2IRange::getMinimum(), OutputDevice::GetOutputSizePixel(), basegfx::B2IRange::getRange(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), Size::Height(), mbIsUnsafeScrolling, mpOwningSpriteCanvas, vcl::unotools::pointFromB2IPoint(), OutputDevice::Pop(), OutputDevice::Push(), canvas::tools::spritePixelAreaFromB2DRange(), and Size::Width().

◆ updateScreen()

bool vclcanvas::SpriteCanvasHelper::updateScreen ( bool  bUpdateAll,
bool &  io_bSurfaceDirty 
)

Member Data Documentation

◆ maLastUpdate

::canvas::tools::ElapsedTime vclcanvas::SpriteCanvasHelper::maLastUpdate
private

For the frame counter timings.

Definition at line 156 of file spritecanvashelper.hxx.

Referenced by renderFrameCounter().

◆ maVDev

VclPtr< VirtualDevice > vclcanvas::SpriteCanvasHelper::maVDev
private

Background compositing surface.

Typically, sprites will be composited in the background, before pushing them to screen. This happens here.

Definition at line 153 of file spritecanvashelper.hxx.

Referenced by genericUpdate(), renderMemUsage(), updateScreen(), and ~SpriteCanvasHelper().

◆ mbIsUnsafeScrolling

bool vclcanvas::SpriteCanvasHelper::mbIsUnsafeScrolling
private

When true, canvas uses the scroll optimization (direct scrolls in front buffer)

Definition at line 165 of file spritecanvashelper.hxx.

Referenced by enableUnsafeScrolling(), isUnsafeScrolling(), and scrollUpdate().

◆ mbShowFrameInfo

bool vclcanvas::SpriteCanvasHelper::mbShowFrameInfo
private

When true, canvas displays debug info on each frame.

Definition at line 159 of file spritecanvashelper.hxx.

Referenced by SpriteCanvasHelper(), and updateScreen().

◆ mbShowSpriteBounds

bool vclcanvas::SpriteCanvasHelper::mbShowSpriteBounds
private

When true, canvas creates all new sprites with red lines in the corners.

Definition at line 162 of file spritecanvashelper.hxx.

Referenced by enableSpriteBounds(), isSpriteBounds(), and SpriteCanvasHelper().

◆ mpOwningSpriteCanvas

SpriteCanvas* vclcanvas::SpriteCanvasHelper::mpOwningSpriteCanvas
private

Set from the init method. used to generate sprites.

Definition at line 146 of file spritecanvashelper.hxx.

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

◆ mpRedrawManager

::canvas::SpriteRedrawManager* vclcanvas::SpriteCanvasHelper::mpRedrawManager
private

Set from the SpriteCanvas: instance coordinating sprite redraw.

Definition at line 143 of file spritecanvashelper.hxx.

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


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