LibreOffice Module canvas (master) 1
|
#include <cairo_canvashelper.hxx>
Public Member Functions | |
CanvasHelper (const CanvasHelper &)=delete | |
make noncopyable More... | |
const CanvasHelper & | operator= (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_Int8 > | getData (css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) |
css::uno::Sequence< sal_Int8 > | getPixel (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< VirtualDevice > | mpVirtualDevice |
bool | mbHaveAlpha |
When true, content is able to represent alpha. More... | |
::cairo::CairoSharedPtr | mpCairo |
::cairo::SurfaceSharedPtr | mpSurface |
::basegfx::B2ISize | maSize |
Definition at line 49 of file cairo_canvashelper.hxx.
|
delete |
make noncopyable
cairocanvas::CanvasHelper::CanvasHelper | ( | ) |
Definition at line 64 of file cairo_canvashelper.cxx.
void cairocanvas::CanvasHelper::clear | ( | ) |
Definition at line 210 of file cairo_canvashelper.cxx.
References basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), maSize, mbHaveAlpha, mpCairo, and SAL_INFO.
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 | ( | ) |
Release all references.
Definition at line 71 of file cairo_canvashelper.cxx.
References VclPtr< class reference_type >::disposeAndClear(), mpCairo, mpDevice, mpSurface, mpSurfaceProvider, and mpVirtualDevice.
Referenced by cairocanvas::SpriteCanvasHelper::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 |
Definition at line 811 of file cairo_canvashelper.cxx.
References a, basegfx::B2DPolygon::append(), basegfx::B2DPolygon::count(), cairocanvas::doPolyPolygonImplementation(), basegfx::B2DPolygon::getB2DPoint(), basegfx::B2DPolygon::getNextControlPoint(), basegfx::B2DPolygon::getPrevControlPoint(), basegfx::B2DPolygon::isClosed(), mpCairo, mpSurfaceProvider, basegfx::B2DPolygon::setB2DPoint(), basegfx::B2DPolygon::setNextControlPoint(), basegfx::B2DPolygon::setPrevControlPoint(), and cairocanvas::Stroke.
Referenced by useStates().
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 | ||
) |
|
inline |
Definition at line 189 of file cairo_canvashelper.hxx.
References mpDevice.
rendering::IntegerBitmapLayout cairocanvas::CanvasHelper::getMemoryLayout | ( | ) |
Definition at line 1990 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 1275 of file cairo_canvashelper.cxx.
References maSize, and mpSurfaceProvider.
Referenced by getMemoryLayout().
|
private |
Definition at line 2001 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 | ||
) |
Definition at line 1074 of file cairo_canvashelper.cxx.
References basegfx::fround(), basegfx::Size2D< typename TYPE >::getHeight(), basegfx::Size2D< typename TYPE >::getWidth(), maSize, mbHaveAlpha, mpCairo, mpSurfaceProvider, SAL_INFO, SAL_WARN, setSurface(), useStates(), x, and y.
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!
rSizePixel | Size of the output surface in pixel. |
rDevice | Reference device this canvas is associated with |
Referenced by cairocanvas::SpriteCanvasHelper::init().
|
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 89 of file cairo_canvashelper.cxx.
References maSize.
void cairocanvas::CanvasHelper::setSurface | ( | const ::cairo::SurfaceSharedPtr & | pSurface, |
bool | bHasAlpha | ||
) |
Definition at line 94 of file cairo_canvashelper.cxx.
References VclPtr< class reference_type >::disposeAndClear(), mbHaveAlpha, mpCairo, mpSurface, and mpVirtualDevice.
Referenced by implDrawBitmapSurface().
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 | ||
) |
|
private |
Definition at line 120 of file cairo_canvashelper.cxx.
References cairocanvas::Clip, doPolyPolygonPath(), basegfx::fround(), mpCairo, SAL_INFO, and cairocanvas::setColor().
Referenced by implDrawBitmapSurface().
|
private |
Definition at line 259 of file cairo_canvashelper.hxx.
Referenced by clear(), getSize(), implDrawBitmapSurface(), and setSize().
|
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().
|
private |
Definition at line 257 of file cairo_canvashelper.hxx.
Referenced by clear(), disposing(), doPolyPolygonPath(), getMemoryLayout(), implDrawBitmapSurface(), setSurface(), and useStates().
|
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().
|
private |
Definition at line 258 of file cairo_canvashelper.hxx.
Referenced by disposing(), and setSurface().
|
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().
|
private |
Definition at line 246 of file cairo_canvashelper.hxx.
Referenced by disposing(), and setSurface().