LibreOffice Module canvas (master) 1
|
Helper class for canvas sprites. More...
#include <dx_spritehelper.hxx>
Public Member Functions | |
SpriteHelper () | |
Create sprite helper. More... | |
void | init (const css::geometry::RealSize2D &rSpriteSize, const SpriteCanvasRef &rSpriteCanvas, const IDXRenderModuleSharedPtr &rRenderModule, const DXSurfaceBitmapSharedPtr &rBitmap, bool bShowSpriteBounds) |
Late-init the sprite helper. More... | |
void | disposing () |
void | redraw (bool &io_bSurfaceDirty) const |
Repaint sprite content via hardware to associated sprite canvas. More... | |
Public Member Functions inherited from canvas::CanvasCustomSpriteHelper | |
CanvasCustomSpriteHelper () | |
virtual | ~CanvasCustomSpriteHelper () |
void | init (const css::geometry::RealSize2D &rSpriteSize, const SpriteSurface::Reference &rOwningSpriteCanvas) |
Init helper. More... | |
void | disposing () |
Object is being disposed, release all internal references. More... | |
void | clearingContent (const Sprite::Reference &rSprite) |
need to call this method for XCanvas::clear(), for opacity tracking More... | |
void | checkDrawBitmap (const Sprite::Reference &rSprite, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState) |
need to call this method for XCanvas::drawBitmap(), for opacity tracking More... | |
void | setAlpha (const Sprite::Reference &rSprite, double alpha) |
void | move (const Sprite::Reference &rSprite, const css::geometry::RealPoint2D &aNewPos, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState) |
void | transform (const Sprite::Reference &rSprite, const css::geometry::AffineMatrix2D &aTransformation) |
void | clip (const Sprite::Reference &rSprite, const css::uno::Reference< css::rendering::XPolyPolygon2D > &aClip) |
void | setPriority (const Sprite::Reference &rSprite, double nPriority) |
void | show (const Sprite::Reference &rSprite) |
void | hide (const Sprite::Reference &rSprite) |
bool | isAreaUpdateOpaque (const ::basegfx::B2DRange &rUpdateArea) const |
const ::basegfx::B2DPoint & | getPosPixel () const |
const ::basegfx::B2DVector & | getSizePixel () const |
::basegfx::B2DRange | getUpdateArea () const |
double | getPriority () const |
::basegfx::B2DRange | getUpdateArea (const ::basegfx::B2DRange &rUntransformedSpriteBounds) const |
Calc sprite update area from given raw sprite bounds. More... | |
bool | isContentFullyOpaque () const |
Returns true, if sprite content bitmap is fully opaque. More... | |
bool | hasTransformChanged () const |
Returns true, if transformation has changed since last transformUpdated() call. More... | |
double | getAlpha () const |
Retrieve current alpha value. More... | |
const css::uno::Reference< css::rendering::XPolyPolygon2D > & | getClip () const |
Retrieve current clip. More... | |
const ::basegfx::B2DHomMatrix & | getTransformation () const |
bool | isActive () const |
Retrieve current activation state. More... | |
Private Member Functions | |
virtual ::basegfx::B2DPolyPolygon | polyPolygonFromXPolyPolygon2D (css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override |
Called to convert an API polygon to a basegfx polygon. More... | |
bool | needRedraw () const |
Returns true, if the sprite really needs redraw. More... | |
Private Attributes | |
SpriteCanvasRef | mpSpriteCanvas |
DXSurfaceBitmapSharedPtr | mpBitmap |
bool | mbTextureDirty |
bool | mbShowSpriteBounds |
Additional Inherited Members | |
Protected Member Functions inherited from canvas::CanvasCustomSpriteHelper | |
void | transformUpdated () const |
Notifies that caller is again in sync with current transformation. More... | |
Helper class for canvas sprites.
This class implements all sprite-related functionality, like that available on the XSprite interface.
Definition at line 42 of file dx_spritehelper.hxx.
dxcanvas::SpriteHelper::SpriteHelper | ( | ) |
Create sprite helper.
Definition at line 44 of file dx_spritehelper.cxx.
References mpBitmap, and mpSpriteCanvas.
void dxcanvas::SpriteHelper::disposing | ( | ) |
Definition at line 73 of file dx_spritehelper.cxx.
References mpBitmap, and mpSpriteCanvas.
void dxcanvas::SpriteHelper::init | ( | const css::geometry::RealSize2D & | rSpriteSize, |
const SpriteCanvasRef & | rSpriteCanvas, | ||
const IDXRenderModuleSharedPtr & | rRenderModule, | ||
const DXSurfaceBitmapSharedPtr & | rBitmap, | ||
bool | bShowSpriteBounds | ||
) |
Late-init the sprite helper.
rSpriteSize | Size of the sprite |
rSpriteCanvas | Sprite canvas this sprite is part of. Object stores ref-counted reference to it, thus, don't forget to pass on disposing()! |
rRenderModule | rendermodule to use |
rSpriteSurface | The surface of the sprite (not the DX texture, but the persistent target of content rendering) |
bShowSpriteBounds | When true, little debug bound rects for sprites are shown |
|
private |
Returns true, if the sprite really needs redraw.
Definition at line 87 of file dx_spritehelper.cxx.
References canvas::CanvasCustomSpriteHelper::getAlpha(), canvas::CanvasCustomSpriteHelper::isActive(), mpBitmap, and mpSpriteCanvas.
|
overrideprivatevirtual |
Called to convert an API polygon to a basegfx polygon.
Implements canvas::CanvasCustomSpriteHelper.
void dxcanvas::SpriteHelper::redraw | ( | bool & | io_bSurfaceDirty | ) | const |
Repaint sprite content via hardware to associated sprite canvas.
io_bSurfaceDirty | Input/output parameter, whether the sprite content is dirty or not. If texture was updated, set to false |
Definition at line 104 of file dx_spritehelper.cxx.
References basegfx::B2DPolyPolygon::count(), canvas::CanvasCustomSpriteHelper::getAlpha(), basegfx::B2DPolyPolygon::getB2DPolygon(), canvas::CanvasCustomSpriteHelper::getClip(), canvas::CanvasCustomSpriteHelper::getPosPixel(), canvas::CanvasCustomSpriteHelper::getSizePixel(), canvas::CanvasCustomSpriteHelper::getTransformation(), basegfx::Range2D< typename TYPE, typename TRAITS >::intersect(), canvas::CanvasCustomSpriteHelper::isActive(), vclcanvas::tools::isRectangle(), mbShowSpriteBounds, mbTextureDirty, mpBitmap, mpSpriteCanvas, dxcanvas::tools::polyPolygonFromXPolyPolygon2D(), and SAL_INFO.
|
private |
Definition at line 98 of file dx_spritehelper.hxx.
Referenced by redraw().
|
mutableprivate |
Definition at line 97 of file dx_spritehelper.hxx.
Referenced by redraw().
|
private |
Definition at line 96 of file dx_spritehelper.hxx.
Referenced by disposing(), needRedraw(), and redraw().
|
private |
Definition at line 94 of file dx_spritehelper.hxx.
Referenced by disposing(), needRedraw(), and redraw().