LibreOffice Module canvas (master)  1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dxcanvas::CanvasHelper Class Reference

Helper class for basic canvas functionality. More...

#include <dx_canvashelper.hxx>

Inheritance diagram for dxcanvas::CanvasHelper:
[legend]

Public Member Functions

 CanvasHelper ()
 
 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (const CanvasHelper &)=delete
 
void disposing ()
 Release all references. More...
 
void setDevice (css::rendering::XGraphicDevice &rDevice)
 Initialize canvas helper. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget)
 Set the target for rendering operations. More...
 
void setTarget (const GraphicsProviderSharedPtr &rTarget, const ::basegfx::B2ISize &rOutputOffset)
 Set the target for rendering operations. More...
 
void clear ()
 
void drawPoint (const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
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 ()
 
void flush () const
 
void modifying ()
 Called from XCanvas base classes, to notify that content is about to change. More...
 

Protected Member Functions

bool needOutput () const
 
void setupGraphicsState (GraphicsSharedPtr const &rGraphics, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 
Gdiplus::CompositingMode calcCompositingMode (sal_Int8 nMode)
 

Protected Attributes

GDIPlusUserSharedPtr mpGdiPlusUser
 Refcounted global GDI+ state container. More...
 
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
GraphicsProviderSharedPtr mpGraphicsProvider
 Provides the Gdiplus::Graphics to render into. More...
 
::basegfx::B2ISize maOutputOffset
 Current (transformation-independent) output buffer offset. More...
 

Detailed Description

Helper class for basic canvas functionality.

Also offers optional backbuffer painting, when providing it with a second HDC to render into.

Definition at line 41 of file dx_canvashelper.hxx.

Constructor & Destructor Documentation

dxcanvas::CanvasHelper::CanvasHelper ( )

Definition at line 103 of file dx_canvashelper.cxx.

References createInstance().

dxcanvas::CanvasHelper::CanvasHelper ( const CanvasHelper )
delete

make noncopyable

Member Function Documentation

Gdiplus::CompositingMode dxcanvas::CanvasHelper::calcCompositingMode ( sal_Int8  nMode)
protected

Definition at line 660 of file dx_canvashelper.cxx.

References ENSURE_OR_THROW.

void dxcanvas::CanvasHelper::clear ( )

Definition at line 145 of file dx_canvashelper.cxx.

References ENSURE_OR_THROW, mpGraphicsProvider, and needOutput().

css::uno::Reference< css::rendering::XCanvasFont > dxcanvas::CanvasHelper::createFont ( const css::rendering::XCanvas *  pCanvas,
const css::rendering::FontRequest &  fontRequest,
const css::uno::Sequence< css::beans::PropertyValue > &  extraFontProperties,
const css::geometry::Matrix2D &  fontMatrix 
)
void dxcanvas::CanvasHelper::disposing ( )

Release all references.

Definition at line 111 of file dx_canvashelper.cxx.

References mpDevice, mpGdiPlusUser, and mpGraphicsProvider.

Referenced by dxcanvas::BitmapCanvasHelper::disposing(), and dxcanvas::SpriteCanvasHelper::disposing().

void dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::drawBitmapModulated ( const css::rendering::XCanvas *  pCanvas,
const css::uno::Reference< css::rendering::XBitmap > &  xBitmap,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
void dxcanvas::CanvasHelper::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 dxcanvas::CanvasHelper::drawPoint ( const css::rendering::XCanvas *  pCanvas,
const css::geometry::RealPoint2D &  aPoint,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
css::uno::Reference< css::rendering::XCachedPrimitive > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 
)
void dxcanvas::CanvasHelper::flush ( ) const

Definition at line 784 of file dx_canvashelper.cxx.

References mpGraphicsProvider, and needOutput().

uno::Reference< rendering::XGraphicDevice > dxcanvas::CanvasHelper::getDevice ( )

Definition at line 652 of file dx_canvashelper.cxx.

References mpDevice.

void dxcanvas::CanvasHelper::modifying ( )
inline

Called from XCanvas base classes, to notify that content is about to change.

Definition at line 223 of file dx_canvashelper.hxx.

bool dxcanvas::CanvasHelper::needOutput ( ) const
inlineprotected
const CanvasHelper& dxcanvas::CanvasHelper::operator= ( const CanvasHelper )
delete
css::uno::Sequence< css::rendering::FontInfo > dxcanvas::CanvasHelper::queryAvailableFonts ( const css::rendering::XCanvas *  pCanvas,
const css::rendering::FontInfo &  aFilter,
const css::uno::Sequence< css::beans::PropertyValue > &  aFontProperties 
)
css::uno::Reference< css::rendering::XPolyPolygon2D > dxcanvas::CanvasHelper::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 
)
void dxcanvas::CanvasHelper::setDevice ( css::rendering::XGraphicDevice &  rDevice)

Initialize canvas helper.

This method late-initializes the canvas helper, providing it with the necessary device and output objects. Note that the CanvasHelper does not take ownership of the passed rDevice reference, nor does it perform any reference counting. Thus, to prevent the reference counted SpriteCanvas object from deletion, the user of this class is responsible for holding ref-counted references itself!

Parameters
rDeviceReference device this canvas is associated with

Definition at line 118 of file dx_canvashelper.cxx.

References mpDevice.

Referenced by dxcanvas::SpriteCanvasHelper::init().

void dxcanvas::CanvasHelper::setTarget ( const GraphicsProviderSharedPtr rTarget)

Set the target for rendering operations.

Parameters
rTargetRender target

Definition at line 123 of file dx_canvashelper.cxx.

References ENSURE_OR_THROW, and mpGraphicsProvider.

Referenced by dxcanvas::BitmapCanvasHelper::setTarget().

void dxcanvas::CanvasHelper::setTarget ( const GraphicsProviderSharedPtr rTarget,
const ::basegfx::B2ISize rOutputOffset 
)

Set the target for rendering operations.

Parameters
rTargetRender target
rOutputOffsetOutput offset in pixel

Definition at line 133 of file dx_canvashelper.cxx.

References ENSURE_OR_THROW, maOutputOffset, and mpGraphicsProvider.

void dxcanvas::CanvasHelper::setupGraphicsState ( GraphicsSharedPtr const &  rGraphics,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
protected

Referenced by drawPoint().

css::uno::Reference< css::rendering::XCachedPrimitive > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 > dxcanvas::CanvasHelper::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 
)

Member Data Documentation

::basegfx::B2ISize dxcanvas::CanvasHelper::maOutputOffset
protected

Current (transformation-independent) output buffer offset.

Definition at line 249 of file dx_canvashelper.hxx.

Referenced by dxcanvas::BitmapCanvasHelper::drawTextLayout(), and setTarget().

css::rendering::XGraphicDevice* dxcanvas::CanvasHelper::mpDevice
protected

Phyical output device.

Deliberately not a refcounted reference, because of potential circular references for spritecanvas.

Definition at line 234 of file dx_canvashelper.hxx.

Referenced by disposing(), dxcanvas::BitmapCanvasHelper::drawTextLayout(), getDevice(), and setDevice().

GDIPlusUserSharedPtr dxcanvas::CanvasHelper::mpGdiPlusUser
protected

Refcounted global GDI+ state container.

Definition at line 227 of file dx_canvashelper.hxx.

Referenced by disposing().

GraphicsProviderSharedPtr dxcanvas::CanvasHelper::mpGraphicsProvider
protected

Provides the Gdiplus::Graphics to render into.

Definition at line 237 of file dx_canvashelper.hxx.

Referenced by clear(), disposing(), drawPoint(), flush(), and setTarget().


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