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 26 of file ogl_canvashelper.hxx.

Member Typedef Documentation

Definition at line 191 of file ogl_canvashelper.hxx.

Constructor & Destructor Documentation

oglcanvas::CanvasHelper::CanvasHelper ( )

Definition at line 348 of file ogl_canvashelper.cxx.

oglcanvas::CanvasHelper::~CanvasHelper ( )

Definition at line 354 of file ogl_canvashelper.cxx.

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

Member Function Documentation

void oglcanvas::CanvasHelper::clear ( )

Definition at line 380 of file ogl_canvashelper.cxx.

References mpRecordedActions.

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 
)
void oglcanvas::CanvasHelper::disposing ( )
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)
css::uno::Reference< css::rendering::XGraphicDevice > oglcanvas::CanvasHelper::getDevice ( )
inline

Definition at line 178 of file ogl_canvashelper.hxx.

References mpDevice.

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

Definition at line 189 of file ogl_canvashelper.hxx.

References mpDevice.

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

Definition at line 188 of file ogl_canvashelper.hxx.

References mpDeviceHelper.

size_t oglcanvas::CanvasHelper::getRecordedActionCount ( ) const

Retrieve number of recorded actions.

Definition at line 946 of file ogl_canvashelper.cxx.

References mpRecordedActions.

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

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

Definition at line 357 of file ogl_canvashelper.cxx.

References mpDevice, mpDeviceHelper, and mpRecordedActions.

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 
)
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 
)
bool oglcanvas::CanvasHelper::renderRecordedActions ( ) const

Write out recorded actions.

Definition at line 930 of file ogl_canvashelper.cxx.

References mpRecordedActions.

void oglcanvas::CanvasHelper::setupGraphicsState ( Action o_action,
const css::rendering::ViewState viewState,
const css::rendering::RenderState &  renderState 
)
private
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 
)
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 
)
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

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 207 of file ogl_canvashelper.hxx.

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

SpriteDeviceHelper* oglcanvas::CanvasHelper::mpDeviceHelper
private

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

shader programs; and caches

Definition at line 212 of file ogl_canvashelper.hxx.

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

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 219 of file ogl_canvashelper.hxx.

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


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