LibreOffice Module canvas (master) 1
|
#include <cairo_spritecanvashelper.hxx>
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 CanvasHelper & | operator= (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_Int8 > | getData (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) |
css::uno::Sequence< sal_Int8 > | getPixel (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::SpriteRedrawManager * | mpRedrawManager |
Set from the SpriteCanvas: instance coordinating sprite redraw. More... | |
SpriteCanvas * | mpOwningSpriteCanvas |
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... | |
Definition at line 40 of file cairo_spritecanvashelper.hxx.
cairocanvas::SpriteCanvasHelper::SpriteCanvasHelper | ( | ) |
Definition at line 91 of file cairo_spritecanvashelper.cxx.
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.
css::uno::Reference< css::rendering::XSprite > cairocanvas::SpriteCanvasHelper::createClonedSprite | ( | const css::uno::Reference< css::rendering::XSprite > & | original | ) |
css::uno::Reference< css::rendering::XCustomSprite > cairocanvas::SpriteCanvasHelper::createCustomSprite | ( | const css::geometry::RealSize2D & | spriteSize | ) |
css::uno::Reference< css::rendering::XAnimatedSprite > cairocanvas::SpriteCanvasHelper::createSpriteFromAnimation | ( | const css::uno::Reference< css::rendering::XAnimation > & | animation | ) |
css::uno::Reference< css::rendering::XAnimatedSprite > cairocanvas::SpriteCanvasHelper::createSpriteFromBitmaps | ( | const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > & | animationBitmaps, |
sal_Int8 | interpolationMode | ||
) |
|
private |
Definition at line 510 of file cairo_spritecanvashelper.cxx.
References cairocanvas::SpriteCanvas::getWindowSurface(), and mpOwningSpriteCanvas.
Referenced by getCompositingSurface(), and getTemporarySurface().
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.
void cairocanvas::SpriteCanvasHelper::genericUpdate | ( | const ::basegfx::B2DRange & | rTotalArea, |
const std::vector< ::canvas::Sprite::Reference > & | rSortedUpdateSprites | ||
) |
Definition at line 416 of file cairo_spritecanvashelper.cxx.
References ENSURE_OR_THROW, cairocanvas::SpriteCanvas::getBufferSurface(), getCompositingSurface(), cairocanvas::SpriteCanvas::getSizePixel(), cairocanvas::SpriteCanvas::getWindowSurface(), Size::Height(), max, mpOwningSpriteCanvas, SAL_INFO, Size::Width(), Point::X(), and Point::Y().
|
private |
Definition at line 483 of file cairo_spritecanvashelper.cxx.
References createSurface(), basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), maCompositingSurfaceSize, mbCompositingSurfaceDirty, mpCompositingSurface, and mpTemporarySurface.
Referenced by genericUpdate(), opaqueUpdate(), scrollUpdate(), and updateScreen().
|
private |
Definition at line 503 of file cairo_spritecanvashelper.cxx.
References createSurface(), maCompositingSurfaceSize, and mpTemporarySurface.
Referenced by scrollUpdate().
void cairocanvas::SpriteCanvasHelper::init | ( | ::canvas::SpriteRedrawManager & | rManager, |
SpriteCanvas & | rOwningSpriteCanvas, | ||
const ::basegfx::B2ISize & | rSize | ||
) |
Definition at line 98 of file cairo_spritecanvashelper.cxx.
References cairocanvas::CanvasHelper::init(), mpOwningSpriteCanvas, and mpRedrawManager.
void cairocanvas::SpriteCanvasHelper::opaqueUpdate | ( | const ::basegfx::B2DRange & | rTotalArea, |
const std::vector< ::canvas::Sprite::Reference > & | rSortedUpdateSprites | ||
) |
Definition at line 371 of file cairo_spritecanvashelper.cxx.
References ENSURE_OR_THROW, cairocanvas::SpriteCanvas::getBufferSurface(), getCompositingSurface(), cairocanvas::SpriteCanvas::getSizePixel(), cairocanvas::SpriteCanvas::getWindowSurface(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), mpOwningSpriteCanvas, and SAL_INFO.
void cairocanvas::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.
rMoveStart | Source rect of the scroll |
rMoveEnd | Dest rect of the scroll |
rUpdateArea | All info necessary, should rMoveStart be partially or fully outside the outdev |
Definition at line 236 of file cairo_spritecanvashelper.cxx.
References canvas::tools::clipScrollArea(), ENSURE_OR_THROW, cairocanvas::SpriteCanvas::getBufferSurface(), getCompositingSurface(), basegfx::Range2D< typename TYPE, typename TRAITS >::getHeight(), basegfx::Size2D< typename TYPE >::getHeight(), basegfx::B2IRange::getMinimum(), cairocanvas::SpriteCanvas::getSizePixel(), getTemporarySurface(), basegfx::Range2D< typename TYPE, typename TRAITS >::getWidth(), basegfx::Size2D< typename TYPE >::getWidth(), cairocanvas::SpriteCanvas::getWindowSurface(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::Range2D< typename TYPE, typename TRAITS >::intersect(), mpOwningSpriteCanvas, SAL_INFO, and canvas::tools::spritePixelAreaFromB2DRange().
bool cairocanvas::SpriteCanvasHelper::updateScreen | ( | const ::basegfx::B2IRange & | rCurrArea, |
bool | bUpdateAll, | ||
bool & | io_bSurfaceDirty | ||
) |
Actually perform the screen update.
rCurrArea | Current window area in absolute screen coordinates |
bUpdateAll | sal_True, if everything must be updated, not only changed sprites |
io_bSurfaceDirty | In/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.
|
private |
Definition at line 132 of file cairo_spritecanvashelper.hxx.
Referenced by getCompositingSurface(), and getTemporarySurface().
|
private |
Definition at line 133 of file cairo_spritecanvashelper.hxx.
Referenced by getCompositingSurface(), and updateScreen().
|
private |
a surface used to composite the frontbuffer image
Definition at line 131 of file cairo_spritecanvashelper.hxx.
Referenced by backgroundPaint(), disposing(), and getCompositingSurface().
|
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().
|
private |
Set from the SpriteCanvas: instance coordinating sprite redraw.
Definition at line 125 of file cairo_spritecanvashelper.hxx.
Referenced by disposing(), init(), and updateScreen().
|
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().