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 40 of file spritecanvashelper.hxx.

Constructor & Destructor Documentation

vclcanvas::SpriteCanvasHelper::SpriteCanvasHelper ( )

Definition at line 119 of file spritecanvashelper.cxx.

References Create(), mbShowFrameInfo, and mbShowSpriteBounds.

vclcanvas::SpriteCanvasHelper::~SpriteCanvasHelper ( )

Definition at line 134 of file spritecanvashelper.cxx.

References VclPtr< VirtualDevice >::disposeAndClear(), and maVDev.

Member Function Documentation

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

Gets called for simple background repaints.

Definition at line 315 of file spritecanvashelper.cxx.

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

css::uno::Reference< css::rendering::XSprite > vclcanvas::SpriteCanvasHelper::createClonedSprite ( const css::uno::Reference< css::rendering::XSprite > &  original)
css::uno::Reference< css::rendering::XCustomSprite > vclcanvas::SpriteCanvasHelper::createCustomSprite ( const css::geometry::RealSize2D &  spriteSize)
css::uno::Reference< css::rendering::XAnimatedSprite > vclcanvas::SpriteCanvasHelper::createSpriteFromAnimation ( const css::uno::Reference< css::rendering::XAnimation > &  animation)
css::uno::Reference< css::rendering::XAnimatedSprite > vclcanvas::SpriteCanvasHelper::createSpriteFromBitmaps ( const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > &  animationBitmaps,
sal_Int8  interpolationMode 
)
void vclcanvas::SpriteCanvasHelper::disposing ( )

Dispose all internal references.

Definition at line 152 of file spritecanvashelper.cxx.

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

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

Definition at line 134 of file spritecanvashelper.hxx.

References mbShowSpriteBounds.

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

Definition at line 125 of file spritecanvashelper.hxx.

References mbIsUnsafeScrolling.

void vclcanvas::SpriteCanvasHelper::genericUpdate ( const ::basegfx::B2DRange rTotalArea,
const std::vector< ::canvas::Sprite::Reference > &  rSortedUpdateSprites 
)
void vclcanvas::SpriteCanvasHelper::init ( const OutDevProviderSharedPtr rOutDev,
SpriteCanvas rOwningSpriteCanvas,
::canvas::SpriteRedrawManager rManager,
bool  bProtect,
bool  bHaveAlpha 
)
css::uno::Any vclcanvas::SpriteCanvasHelper::isSpriteBounds ( ) const
inline

Definition at line 130 of file spritecanvashelper.hxx.

References mbShowSpriteBounds.

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

Definition at line 121 of file spritecanvashelper.hxx.

References mbIsUnsafeScrolling.

void vclcanvas::SpriteCanvasHelper::opaqueUpdate ( const ::basegfx::B2DRange rTotalArea,
const std::vector< ::canvas::Sprite::Reference > &  rSortedUpdateSprites 
)
void vclcanvas::SpriteCanvasHelper::renderFrameCounter ( OutputDevice rOutDev)
private
void vclcanvas::SpriteCanvasHelper::renderMemUsage ( OutputDevice rOutDev)
private
void vclcanvas::SpriteCanvasHelper::renderSpriteCount ( OutputDevice rOutDev)
private
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 329 of file spritecanvashelper.cxx.

References canvas::tools::clipScrollArea(), ENSURE_OR_THROW, vclcanvas::SpriteCanvas::getBackBuffer(), vclcanvas::SpriteCanvas::getFrontBuffer(), mbIsUnsafeScrolling, mpOwningSpriteCanvas, vcl::unotools::pointFromB2IPoint(), and canvas::tools::spritePixelAreaFromB2DRange().

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

Member Data Documentation

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

For the frame counter timings.

Definition at line 158 of file spritecanvashelper.hxx.

Referenced by renderFrameCounter().

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 155 of file spritecanvashelper.hxx.

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

bool vclcanvas::SpriteCanvasHelper::mbIsUnsafeScrolling
private

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

Definition at line 167 of file spritecanvashelper.hxx.

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

bool vclcanvas::SpriteCanvasHelper::mbShowFrameInfo
private

When true, canvas displays debug info on each frame.

Definition at line 161 of file spritecanvashelper.hxx.

Referenced by SpriteCanvasHelper(), and updateScreen().

bool vclcanvas::SpriteCanvasHelper::mbShowSpriteBounds
private

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

Definition at line 164 of file spritecanvashelper.hxx.

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

SpriteCanvas* vclcanvas::SpriteCanvasHelper::mpOwningSpriteCanvas
private

Set from the init method. used to generate sprites.

Definition at line 148 of file spritecanvashelper.hxx.

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

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

Set from the SpriteCanvas: instance coordinating sprite redraw.

Definition at line 145 of file spritecanvashelper.hxx.

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


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