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

SurfaceProvider * mpSurfaceProvider
 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)
 

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 49 of file cairo_canvashelper.hxx.

Constructor & Destructor Documentation

◆ CanvasHelper() [1/2]

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

make noncopyable

◆ CanvasHelper() [2/2]

cairocanvas::CanvasHelper::CanvasHelper ( )

Definition at line 64 of file cairo_canvashelper.cxx.

Member Function Documentation

◆ clear()

void cairocanvas::CanvasHelper::clear ( )

◆ createFont()

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 
)

◆ disposing()

void cairocanvas::CanvasHelper::disposing ( )

◆ doPolyPolygonPath()

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

◆ drawBezier()

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 
)

◆ drawBitmap()

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 
)

◆ drawBitmapModulated()

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 
)

◆ drawLine()

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 
)

◆ drawPolyPolygon()

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 
)

◆ drawText()

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 
)

◆ drawTextLayout()

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 
)

◆ fillPolyPolygon()

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 
)

◆ fillTexturedPolyPolygon()

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 
)

◆ fillTextureMappedPolyPolygon()

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 
)

◆ getData()

css::uno::Sequence< sal_Int8 > cairocanvas::CanvasHelper::getData ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerRectangle2D &  rect 
)

◆ getDevice()

css::uno::Reference< css::rendering::XGraphicDevice > cairocanvas::CanvasHelper::getDevice ( )
inline

Definition at line 189 of file cairo_canvashelper.hxx.

References mpDevice.

◆ getMemoryLayout()

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

Definition at line 1990 of file cairo_canvashelper.cxx.

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

◆ getPixel()

css::uno::Sequence< sal_Int8 > cairocanvas::CanvasHelper::getPixel ( css::rendering::IntegerBitmapLayout &  bitmapLayout,
const css::geometry::IntegerPoint2D &  pos 
)

◆ getScaledBitmap()

css::uno::Reference< css::rendering::XBitmap > cairocanvas::CanvasHelper::getScaledBitmap ( const css::geometry::RealSize2D &  newSize,
bool  beFast 
)

◆ getSize()

geometry::IntegerSize2D cairocanvas::CanvasHelper::getSize ( ) const

Definition at line 1275 of file cairo_canvashelper.cxx.

References maSize, and mpSurfaceProvider.

Referenced by getMemoryLayout().

◆ impl_getMemoryLayout()

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

Definition at line 2001 of file cairo_canvashelper.cxx.

References mbHaveAlpha.

Referenced by getMemoryLayout().

◆ implDrawBitmapSurface()

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 
)

◆ init()

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().

◆ operator=()

const CanvasHelper & cairocanvas::CanvasHelper::operator= ( const CanvasHelper )
delete

◆ queryAvailableFonts()

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 
)

◆ queryStrokeShapes()

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 
)

◆ repaint()

bool cairocanvas::CanvasHelper::repaint ( const ::cairo::SurfaceSharedPtr pSurface,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)

◆ setSize()

void cairocanvas::CanvasHelper::setSize ( const ::basegfx::B2ISize rSize)

Definition at line 89 of file cairo_canvashelper.cxx.

References maSize.

◆ setSurface()

void cairocanvas::CanvasHelper::setSurface ( const ::cairo::SurfaceSharedPtr pSurface,
bool  bHasAlpha 
)

◆ strokePolyPolygon()

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 
)

◆ strokeTexturedPolyPolygon()

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 
)

◆ strokeTextureMappedPolyPolygon()

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 
)

◆ useStates()

void cairocanvas::CanvasHelper::useStates ( const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState,
bool  setColor 
)
private

Member Data Documentation

◆ maSize

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

Definition at line 259 of file cairo_canvashelper.hxx.

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

◆ mbHaveAlpha

bool cairocanvas::CanvasHelper::mbHaveAlpha
private

When true, content is able to represent alpha.

Definition at line 255 of file cairo_canvashelper.hxx.

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

◆ mpCairo

::cairo::CairoSharedPtr cairocanvas::CanvasHelper::mpCairo
private

◆ mpDevice

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 242 of file cairo_canvashelper.hxx.

Referenced by disposing(), and getDevice().

◆ mpSurface

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

Definition at line 258 of file cairo_canvashelper.hxx.

Referenced by disposing(), and setSurface().

◆ mpSurfaceProvider

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 235 of file cairo_canvashelper.hxx.

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

◆ mpVirtualDevice

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

Definition at line 246 of file cairo_canvashelper.hxx.

Referenced by disposing(), and setSurface().


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