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

Helper class for basic canvas functionality. More...

#include <ogl_canvashelper.hxx>

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

Classes

struct  Action
 

Public Types

typedef o3tl::cow_wrapper< std::vector< Action >, o3tl::ThreadSafeRefCountingPolicyRecordVectorT
 

Public Member Functions

 CanvasHelper ()
 
 ~CanvasHelper ()
 
CanvasHelperoperator= (const CanvasHelper &)
 
void disposing ()
 Release all references. More...
 
void init (css::rendering::XGraphicDevice &rDevice, SpriteDeviceHelper &rDeviceHelper)
 Initialize canvas helper. More...
 
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 > &layoutetText, 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 ()
 
bool renderRecordedActions () const
 Write out recorded actions. More...
 
size_t getRecordedActionCount () const
 Retrieve number of recorded actions. More...
 
SpriteDeviceHelpergetDeviceHelper () const
 
css::rendering::XGraphicDevice * getDevice () const
 

Private Member Functions

 CanvasHelper (const CanvasHelper &)=delete
 
void setupGraphicsState (Action &o_action, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
 

Private Attributes

css::rendering::XGraphicDevice * mpDevice
 Phyical output device. More...
 
SpriteDeviceHelpermpDeviceHelper
 Internal helper - used for a few global GL objects, e.g. More...
 
RecordVectorT mpRecordedActions
 Ptr to array of recorded render calls. More...
 

Detailed Description

Helper class for basic canvas functionality.

Definition at line 22 of file ogl_canvashelper.hxx.

Member Typedef Documentation

◆ RecordVectorT

Definition at line 189 of file ogl_canvashelper.hxx.

Constructor & Destructor Documentation

◆ CanvasHelper() [1/2]

oglcanvas::CanvasHelper::CanvasHelper ( )

Definition at line 344 of file ogl_canvashelper.cxx.

◆ ~CanvasHelper()

oglcanvas::CanvasHelper::~CanvasHelper ( )

Definition at line 349 of file ogl_canvashelper.cxx.

◆ CanvasHelper() [2/2]

oglcanvas::CanvasHelper::CanvasHelper ( const CanvasHelper )
privatedelete

Member Function Documentation

◆ clear()

void oglcanvas::CanvasHelper::clear ( )

Definition at line 375 of file ogl_canvashelper.cxx.

References mpRecordedActions.

◆ createFont()

css::uno::Reference< css::rendering::XCanvasFont > oglcanvas::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 oglcanvas::CanvasHelper::disposing ( )

◆ drawBezier()

void oglcanvas::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 > oglcanvas::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 > oglcanvas::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 oglcanvas::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 > oglcanvas::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 > oglcanvas::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 > oglcanvas::CanvasHelper::drawTextLayout ( const css::rendering::XCanvas *  pCanvas,
const css::uno::Reference< css::rendering::XTextLayout > &  layoutetText,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)

◆ fillPolyPolygon()

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

◆ getDevice() [1/2]

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

Definition at line 174 of file ogl_canvashelper.hxx.

References mpDevice.

◆ getDevice() [2/2]

css::rendering::XGraphicDevice * oglcanvas::CanvasHelper::getDevice ( ) const
inline

Definition at line 185 of file ogl_canvashelper.hxx.

References mpDevice.

◆ getDeviceHelper()

SpriteDeviceHelper * oglcanvas::CanvasHelper::getDeviceHelper ( ) const
inline

Definition at line 184 of file ogl_canvashelper.hxx.

References mpDeviceHelper.

◆ getRecordedActionCount()

size_t oglcanvas::CanvasHelper::getRecordedActionCount ( ) const

Retrieve number of recorded actions.

Definition at line 947 of file ogl_canvashelper.cxx.

References mpRecordedActions.

◆ init()

void oglcanvas::CanvasHelper::init ( css::rendering::XGraphicDevice &  rDevice,
SpriteDeviceHelper rDeviceHelper 
)

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

Referenced by oglcanvas::BitmapCanvasHelper::init().

◆ operator=()

CanvasHelper & oglcanvas::CanvasHelper::operator= ( const CanvasHelper rSrc)

Definition at line 352 of file ogl_canvashelper.cxx.

References mpDevice, mpDeviceHelper, and mpRecordedActions.

◆ queryAvailableFonts()

css::uno::Sequence< css::rendering::FontInfo > oglcanvas::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 > oglcanvas::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 
)

◆ renderRecordedActions()

bool oglcanvas::CanvasHelper::renderRecordedActions ( ) const

Write out recorded actions.

Definition at line 931 of file ogl_canvashelper.cxx.

References mpRecordedActions.

◆ setupGraphicsState()

void oglcanvas::CanvasHelper::setupGraphicsState ( Action o_action,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
private

◆ strokePolyPolygon()

css::uno::Reference< css::rendering::XCachedPrimitive > oglcanvas::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 > oglcanvas::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 > oglcanvas::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

◆ mpDevice

css::rendering::XGraphicDevice* oglcanvas::CanvasHelper::mpDevice
private

Phyical output device.

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

Definition at line 203 of file ogl_canvashelper.hxx.

Referenced by disposing(), getDevice(), and operator=().

◆ mpDeviceHelper

SpriteDeviceHelper* oglcanvas::CanvasHelper::mpDeviceHelper
private

Internal helper - used for a few global GL objects, e.g.

shader programs; and caches

Definition at line 208 of file ogl_canvashelper.hxx.

Referenced by disposing(), getDeviceHelper(), and operator=().

◆ mpRecordedActions

RecordVectorT oglcanvas::CanvasHelper::mpRecordedActions
private

Ptr to array of recorded render calls.

Gets shared copy-on-write, when this CanvasHelper is copied (used e.g. for CanvasBitmap)

Definition at line 215 of file ogl_canvashelper.hxx.

Referenced by clear(), disposing(), getRecordedActionCount(), operator=(), and renderRecordedActions().


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