LibreOffice Module canvas (master) 1
|
Helper class for basic canvas functionality. More...
#include <dx_canvashelper.hxx>
Public Member Functions | |
CanvasHelper () | |
CanvasHelper (const CanvasHelper &)=delete | |
make noncopyable More... | |
const CanvasHelper & | operator= (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... | |
Helper class for basic canvas functionality.
Also offers optional backbuffer painting, when providing it with a second HDC to render into.
Definition at line 40 of file dx_canvashelper.hxx.
dxcanvas::CanvasHelper::CanvasHelper | ( | ) |
Definition at line 126 of file dx_canvashelper.cxx.
References createInstance().
|
delete |
make noncopyable
|
protected |
Definition at line 683 of file dx_canvashelper.cxx.
References ENSURE_OR_THROW.
void dxcanvas::CanvasHelper::clear | ( | ) |
Definition at line 168 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 134 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 | ||
) |
Definition at line 185 of file dx_canvashelper.cxx.
References ENSURE_OR_THROW, mpGraphicsProvider, needOutput(), dxcanvas::tools::sequenceToArgb(), and setupGraphicsState().
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 807 of file dx_canvashelper.cxx.
References mpGraphicsProvider, and needOutput().
uno::Reference< rendering::XGraphicDevice > dxcanvas::CanvasHelper::getDevice | ( | ) |
Definition at line 675 of file dx_canvashelper.cxx.
References mpDevice.
|
inline |
Called from XCanvas base classes, to notify that content is about to change.
Definition at line 222 of file dx_canvashelper.hxx.
|
inlineprotected |
Definition at line 238 of file dx_canvashelper.hxx.
References mpGraphicsProvider.
Referenced by dxcanvas::BitmapCanvasHelper::clear(), clear(), drawPoint(), dxcanvas::BitmapCanvasHelper::drawTextLayout(), and flush().
|
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!
rDevice | Reference device this canvas is associated with |
Definition at line 141 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.
rTarget | Render target |
Definition at line 146 of file dx_canvashelper.cxx.
References ENSURE_OR_THROW, mpGraphicsProvider, and rTarget.
Referenced by dxcanvas::BitmapCanvasHelper::setTarget().
void dxcanvas::CanvasHelper::setTarget | ( | const GraphicsProviderSharedPtr & | rTarget, |
const ::basegfx::B2ISize & | rOutputOffset | ||
) |
Set the target for rendering operations.
rTarget | Render target |
rOutputOffset | Output offset in pixel |
Definition at line 156 of file dx_canvashelper.cxx.
References ENSURE_OR_THROW, maOutputOffset, mpGraphicsProvider, and rTarget.
|
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 | ||
) |
|
protected |
Current (transformation-independent) output buffer offset.
Definition at line 248 of file dx_canvashelper.hxx.
Referenced by dxcanvas::BitmapCanvasHelper::drawTextLayout(), and setTarget().
|
protected |
Phyical output device.
Deliberately not a refcounted reference, because of potential circular references for spritecanvas.
Definition at line 233 of file dx_canvashelper.hxx.
Referenced by disposing(), dxcanvas::BitmapCanvasHelper::drawTextLayout(), getDevice(), and setDevice().
|
protected |
Refcounted global GDI+ state container.
Definition at line 226 of file dx_canvashelper.hxx.
Referenced by disposing().
|
protected |
Provides the Gdiplus::Graphics to render into.
Definition at line 236 of file dx_canvashelper.hxx.
Referenced by clear(), disposing(), drawPoint(), flush(), needOutput(), and setTarget().