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

#include <cairo_canvashelper.hxx>

Inheritance diagram for cairocanvas::CanvasHelper:
[legend]
Collaboration diagram for cairocanvas::CanvasHelper:
[legend]

Public Member Functions

 CanvasHelper (const CanvasHelper &)=delete
 make noncopyable More...
 
const CanvasHelperoperator= (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_Int8getData (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect)
 
css::uno::Sequence< sal_Int8getPixel (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)
 

Protected Attributes

SurfaceProvidermpSurfaceProvider
 Surface provider. More...
 
css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 

Private Member Functions

void useStates (const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, bool setColor)
 
css::rendering::IntegerBitmapLayout impl_getMemoryLayout (sal_Int32 nWidth, sal_Int32 nHeight)
 
void clip_cairo_from_dev (::OutputDevice const &rOutDev)
 

Private Attributes

VclPtr< VirtualDevicempVirtualDevice
 
bool mbHaveAlpha
 When true, content is able to represent alpha. More...
 
::cairo::CairoSharedPtr mpCairo
 
::cairo::SurfaceSharedPtr mpSurface
 
::basegfx::B2ISize maSize
 

Detailed Description

Definition at line 53 of file cairo_canvashelper.hxx.

Constructor & Destructor Documentation

cairocanvas::CanvasHelper::CanvasHelper ( const CanvasHelper )
delete

make noncopyable

cairocanvas::CanvasHelper::CanvasHelper ( )

Definition at line 69 of file cairo_canvashelper.cxx.

Member Function Documentation

void cairocanvas::CanvasHelper::clear ( )
void cairocanvas::CanvasHelper::clip_cairo_from_dev ( ::OutputDevice const &  rOutDev)
private
css::uno::Reference< css::rendering::XCanvasFont > cairocanvas::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 cairocanvas::CanvasHelper::disposing ( )
void cairocanvas::CanvasHelper::doPolyPolygonPath ( const css::uno::Reference< css::rendering::XPolyPolygon2D > &  xPolyPolygon,
Operation  aOperation,
bool  bNoLineJoin = false,
const css::uno::Sequence< css::rendering::Texture > *  pTextures = nullptr 
) const
void cairocanvas::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 > cairocanvas::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 > cairocanvas::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 cairocanvas::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 
)
css::uno::Reference< css::rendering::XCachedPrimitive > cairocanvas::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 > cairocanvas::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 > cairocanvas::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 > cairocanvas::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 > cairocanvas::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 > cairocanvas::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 
)
css::uno::Sequence< sal_Int8 > cairocanvas::CanvasHelper::getData ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerRectangle2D &  rect 
)
css::uno::Reference< css::rendering::XGraphicDevice > cairocanvas::CanvasHelper::getDevice ( )
inline

Definition at line 193 of file cairo_canvashelper.hxx.

References mpDevice.

rendering::IntegerBitmapLayout cairocanvas::CanvasHelper::getMemoryLayout ( )

Definition at line 1984 of file cairo_canvashelper.cxx.

References getSize(), impl_getMemoryLayout(), and mpCairo.

css::uno::Sequence< sal_Int8 > cairocanvas::CanvasHelper::getPixel ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerPoint2D &  pos 
)
css::uno::Reference< css::rendering::XBitmap > cairocanvas::CanvasHelper::getScaledBitmap ( const css::geometry::RealSize2D &  newSize,
bool  beFast 
)
geometry::IntegerSize2D cairocanvas::CanvasHelper::getSize ( ) const

Definition at line 1263 of file cairo_canvashelper.cxx.

References maSize, and mpSurfaceProvider.

Referenced by getMemoryLayout().

rendering::IntegerBitmapLayout cairocanvas::CanvasHelper::impl_getMemoryLayout ( sal_Int32  nWidth,
sal_Int32  nHeight 
)
private

Definition at line 1995 of file cairo_canvashelper.cxx.

References mbHaveAlpha.

Referenced by getMemoryLayout().

uno::Reference< rendering::XCachedPrimitive > cairocanvas::CanvasHelper::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 
)
void cairocanvas::CanvasHelper::init ( const ::basegfx::B2ISize rSizePixel,
SurfaceProvider rSurfaceProvider,
css::rendering::XGraphicDevice *  pDevice 
)

Initialize canvas helper.

This method late-initializes the canvas helper, providing it with the necessary device and size. 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
rSizePixelSize of the output surface in pixel.
rDeviceReference device this canvas is associated with

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

const CanvasHelper& cairocanvas::CanvasHelper::operator= ( const CanvasHelper )
delete
css::uno::Sequence< css::rendering::FontInfo > cairocanvas::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 > cairocanvas::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 
)
bool cairocanvas::CanvasHelper::repaint ( const ::cairo::SurfaceSharedPtr pSurface,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
void cairocanvas::CanvasHelper::setSize ( const ::basegfx::B2ISize rSize)

Definition at line 98 of file cairo_canvashelper.cxx.

References maSize.

void cairocanvas::CanvasHelper::setSurface ( const ::cairo::SurfaceSharedPtr pSurface,
bool  bHasAlpha 
)
css::uno::Reference< css::rendering::XCachedPrimitive > cairocanvas::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 > cairocanvas::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 > cairocanvas::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 
)
void cairocanvas::CanvasHelper::useStates ( const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState,
bool  setColor 
)
private

Member Data Documentation

::basegfx::B2ISize cairocanvas::CanvasHelper::maSize
private

Definition at line 263 of file cairo_canvashelper.hxx.

Referenced by clear(), getSize(), implDrawBitmapSurface(), and setSize().

bool cairocanvas::CanvasHelper::mbHaveAlpha
private

When true, content is able to represent alpha.

Definition at line 259 of file cairo_canvashelper.hxx.

Referenced by clear(), impl_getMemoryLayout(), implDrawBitmapSurface(), and setSurface().

::cairo::CairoSharedPtr cairocanvas::CanvasHelper::mpCairo
private
css::rendering::XGraphicDevice* cairocanvas::CanvasHelper::mpDevice
protected

Phyical output device.

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

Definition at line 246 of file cairo_canvashelper.hxx.

Referenced by disposing(), and getDevice().

::cairo::SurfaceSharedPtr cairocanvas::CanvasHelper::mpSurface
private

Definition at line 262 of file cairo_canvashelper.hxx.

Referenced by disposing(), and setSurface().

SurfaceProvider* cairocanvas::CanvasHelper::mpSurfaceProvider
protected

Surface provider.

Deliberately not a refcounted reference, because of potential circular references for canvas. Provides us with our output surface and associated functionality.

Definition at line 239 of file cairo_canvashelper.hxx.

Referenced by clip_cairo_from_dev(), disposing(), doPolyPolygonPath(), getSize(), and implDrawBitmapSurface().

VclPtr<VirtualDevice> cairocanvas::CanvasHelper::mpVirtualDevice
private

Definition at line 250 of file cairo_canvashelper.hxx.

Referenced by disposing(), and setSurface().


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