LibreOffice Module canvas (master) 1
|
#include <spritecanvashelper.hxx>
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 CanvasHelper & | operator= (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_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 () |
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::SpriteRedrawManager * | mpRedrawManager |
Set from the SpriteCanvas: instance coordinating sprite redraw. More... | |
SpriteCanvas * | mpOwningSpriteCanvas |
Set from the init method. used to generate sprites. More... | |
VclPtr< VirtualDevice > | maVDev |
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... | |
Definition at line 38 of file spritecanvashelper.hxx.
vclcanvas::SpriteCanvasHelper::SpriteCanvasHelper | ( | ) |
Definition at line 119 of file spritecanvashelper.cxx.
References Create(), mbShowFrameInfo, and mbShowSpriteBounds.
vclcanvas::SpriteCanvasHelper::~SpriteCanvasHelper | ( | ) |
Definition at line 136 of file spritecanvashelper.cxx.
References VclPtr< class reference_type >::disposeAndClear(), and maVDev.
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.
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 154 of file spritecanvashelper.cxx.
References vclcanvas::CanvasHelper::disposing(), mpOwningSpriteCanvas, and mpRedrawManager.
|
inline |
Definition at line 132 of file spritecanvashelper.hxx.
References mbShowSpriteBounds.
|
inline |
Definition at line 123 of file spritecanvashelper.hxx.
References mbIsUnsafeScrolling.
void vclcanvas::SpriteCanvasHelper::genericUpdate | ( | const ::basegfx::B2DRange & | rTotalArea, |
const std::vector< ::canvas::Sprite::Reference > & | rSortedUpdateSprites | ||
) |
Definition at line 457 of file spritecanvashelper.cxx.
References vcl::unotools::b2DPointFromPoint(), OutputDevice::DrawOutDev(), OutputDevice::EnableMapMode(), ENSURE_OR_THROW, vclcanvas::SpriteCanvas::getBackBuffer(), vclcanvas::SpriteCanvas::getFrontBuffer(), OutputDevice::GetOutputSizePixel(), canvas::Sprite::getPosPixel(), Size::Height(), maVDev, max, mpOwningSpriteCanvas, vclcanvas::Sprite::redraw(), OutputDevice::SetAntialiasing(), and Size::Width().
void vclcanvas::SpriteCanvasHelper::init | ( | const OutDevProviderSharedPtr & | rOutDev, |
SpriteCanvas & | rOwningSpriteCanvas, | ||
::canvas::SpriteRedrawManager & | rManager, | ||
bool | bProtect, | ||
bool | bHaveAlpha | ||
) |
Definition at line 142 of file spritecanvashelper.cxx.
References vclcanvas::CanvasHelper::init(), mpOwningSpriteCanvas, and mpRedrawManager.
|
inline |
Definition at line 128 of file spritecanvashelper.hxx.
References mbShowSpriteBounds.
|
inline |
Definition at line 119 of file spritecanvashelper.hxx.
References mbIsUnsafeScrolling.
void vclcanvas::SpriteCanvasHelper::opaqueUpdate | ( | const ::basegfx::B2DRange & | rTotalArea, |
const std::vector< ::canvas::Sprite::Reference > & | rSortedUpdateSprites | ||
) |
|
private |
Definition at line 551 of file spritecanvashelper.cxx.
References canvas::tools::ElapsedTime::getElapsedTime(), maLastUpdate, canvas::tools::ElapsedTime::reset(), and text().
Referenced by updateScreen().
|
private |
Definition at line 619 of file spritecanvashelper.cxx.
References canvas::SpriteRedrawManager::forEachSprite(), vclcanvas::SpriteCanvas::getBackBuffer(), Size::Height(), maVDev, mpOwningSpriteCanvas, mpRedrawManager, nPixel, text(), and Size::Width().
Referenced by updateScreen().
|
private |
Definition at line 598 of file spritecanvashelper.cxx.
References canvas::SpriteRedrawManager::forEachSprite(), mpRedrawManager, nCount, and text().
Referenced by updateScreen().
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.
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 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().
bool vclcanvas::SpriteCanvasHelper::updateScreen | ( | bool | bUpdateAll, |
bool & | io_bSurfaceDirty | ||
) |
Actually perform the screen update.
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 194 of file spritecanvashelper.cxx.
References canvas::SpriteRedrawManager::clearChangeRecords(), OutputDevice::DrawOutDev(), OutputDevice::EnableMapMode(), vcl::Window::ExpandPaintClipRegion(), OutputDevice::Flush(), vclcanvas::CanvasHelper::flush(), canvas::SpriteRedrawManager::forEachSprite(), canvas::SpriteRedrawManager::forEachSpriteArea(), FPS_BOUNDS, vclcanvas::SpriteCanvas::getBackBuffer(), vclcanvas::SpriteCanvas::getFrontBuffer(), vcl::Window::GetOutDev(), OutputDevice::GetOutDevType(), OutputDevice::GetOutputSizePixel(), OutputDevice::GetOwnerWindow(), maVDev, mbShowFrameInfo, mpOwningSpriteCanvas, mpRedrawManager, OUTDEV_WINDOW, renderFrameCounter(), renderMemUsage(), renderSpriteCount(), SAL_INFO, OutputDevice::SetAntialiasing(), OutputDevice::SetClipRegion(), and canvas::SpriteRedrawManager::updateSprite().
|
private |
For the frame counter timings.
Definition at line 156 of file spritecanvashelper.hxx.
Referenced by renderFrameCounter().
|
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().
|
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().
|
private |
When true, canvas displays debug info on each frame.
Definition at line 159 of file spritecanvashelper.hxx.
Referenced by SpriteCanvasHelper(), and updateScreen().
|
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().
|
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().
|
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().