LibreOffice Module canvas (master) 1
|
Helper class for basic canvas functionality. More...
#include <ogl_canvashelper.hxx>
Classes | |
struct | Action |
Public Types | |
typedef o3tl::cow_wrapper< std::vector< Action >, o3tl::ThreadSafeRefCountingPolicy > | RecordVectorT |
Public Member Functions | |
CanvasHelper () | |
~CanvasHelper () | |
CanvasHelper & | operator= (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... | |
SpriteDeviceHelper * | getDeviceHelper () 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... | |
SpriteDeviceHelper * | mpDeviceHelper |
Internal helper - used for a few global GL objects, e.g. More... | |
RecordVectorT | mpRecordedActions |
Ptr to array of recorded render calls. More... | |
Helper class for basic canvas functionality.
Definition at line 22 of file ogl_canvashelper.hxx.
typedef o3tl::cow_wrapper< std::vector<Action>, o3tl::ThreadSafeRefCountingPolicy > oglcanvas::CanvasHelper::RecordVectorT |
Definition at line 189 of file ogl_canvashelper.hxx.
oglcanvas::CanvasHelper::CanvasHelper | ( | ) |
Definition at line 344 of file ogl_canvashelper.cxx.
oglcanvas::CanvasHelper::~CanvasHelper | ( | ) |
Definition at line 349 of file ogl_canvashelper.cxx.
|
privatedelete |
void oglcanvas::CanvasHelper::clear | ( | ) |
Definition at line 375 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 | ( | ) |
Release all references.
Definition at line 360 of file ogl_canvashelper.cxx.
References mpDevice, mpDeviceHelper, mpRecordedActions, and o3tl::cow_wrapper< typename T, class MTPolicy >::swap().
Referenced by oglcanvas::BitmapCanvasHelper::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 | ||
) |
|
inline |
Definition at line 174 of file ogl_canvashelper.hxx.
References mpDevice.
|
inline |
Definition at line 185 of file ogl_canvashelper.hxx.
References mpDevice.
|
inline |
Definition at line 184 of file ogl_canvashelper.hxx.
References mpDeviceHelper.
size_t oglcanvas::CanvasHelper::getRecordedActionCount | ( | ) | const |
Retrieve number of recorded actions.
Definition at line 947 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!
rDevice | Reference device this canvas is associated with |
Referenced by oglcanvas::BitmapCanvasHelper::init().
CanvasHelper & oglcanvas::CanvasHelper::operator= | ( | const CanvasHelper & | rSrc | ) |
Definition at line 352 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 931 of file ogl_canvashelper.cxx.
References mpRecordedActions.
|
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 | ||
) |
|
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=().
|
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=().
|
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().