LibreOffice Module drawinglayer (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
drawinglayer::primitive2d::BufferedDecompositionPrimitive2D Class Referenceabstract

BufferedDecompositionPrimitive2D class. More...

#include <BufferedDecompositionPrimitive2D.hxx>

Inheritance diagram for drawinglayer::primitive2d::BufferedDecompositionPrimitive2D:
[legend]
Collaboration diagram for drawinglayer::primitive2d::BufferedDecompositionPrimitive2D:
[legend]

Public Member Functions

 BufferedDecompositionPrimitive2D ()
 
virtual void get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
 The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2DDecomposition is empty. More...
 
void setTransparenceForShadow (sal_uInt16 nTransparenceForShadow)
 
sal_uInt16 getTransparenceForShadow () const
 
- Public Member Functions inherited from drawinglayer::primitive2d::BasePrimitive2D
 BasePrimitive2D ()
 
virtual ~BasePrimitive2D () override
 
virtual bool operator== (const BasePrimitive2D &rPrimitive) const
 the ==operator is mainly needed to allow testing newly-created primitives against their last incarnation which buffers/holds the made decompositions. More...
 
bool operator!= (const BasePrimitive2D &rPrimitive) const
 
virtual basegfx::B2DRange getB2DRange (const geometry::ViewInformation2D &rViewInformation) const
 The default implementation will use getDecomposition results to create the range. More...
 
virtual sal_uInt32 getPrimitive2DID () const =0
 provide unique ID for fast identifying of known primitive implementations in renderers. More...
 
virtual void get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const
 The default implementation will return an empty sequence. More...
 
Primitive2DContainer getDecomposition (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters)
 The getDecomposition implementation for UNO API will use getDecomposition from this implementation. More...
 
css::geometry::RealRectangle2D getRange (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters)
 The getRange implementation for UNO API will use getRange from this implementation. More...
 
virtual sal_Int64 estimateUsage ()
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Protected Member Functions

const Primitive2DContainergetBuffered2DDecomposition () const
 access methods to maBuffered2DDecomposition. More...
 
void setBuffered2DDecomposition (Primitive2DContainer &&rNew)
 
virtual void create2DDecomposition (Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const =0
 method which is to be used to implement the local decomposition of a 2D primitive. More...
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 

Private Attributes

Primitive2DContainer maBuffered2DDecomposition
 a sequence used for buffering the last create2DDecomposition() result More...
 
sal_uInt16 mnTransparenceForShadow = 0
 When a shadow wraps a list of primitives, this primitive wants to influence the transparency of the shadow. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * operator new (std::size_t nSize)
 
static void * operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 
- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

BufferedDecompositionPrimitive2D class.

Baseclass for all C++ implementations of css::graphic::XPrimitive2D which want to buffer the decomposition result

Buffering the decomposition is the most-used buffering and is thus used my most primitive implementations which support a decomposition as base class.

The buffering is done by holding the last decomposition in the local parameter maBuffered2DDecomposition. The default implementation of get2DDecomposition checks if maBuffered2DDecomposition is empty. If yes, it uses create2DDecomposition to create the content. In all cases, maBuffered2DDecomposition is returned.

For view-dependent primitives derived from Primitive2DBufferDecomposition more needs to be done when the decomposition depends on parts of the parameter ViewInformation2D. This defines a standard method for processing these:

Implement a view-dependent get2DDecomposition doing the following steps: (a) Locally extract needed parameters from ViewInformation2D to new, local parameters (this may be a complete local copy of ViewInformation2D) (b) If a buffered decomposition exists, ckeck if one of the new local parameters differs from the corresponding locally remembered (as member) ones. If yes, clear maBuffered2DDecomposition (d) call baseclass::get2DDecomposition which will use create2DDecomposition to fill maBuffered2DDecomposition if it's empty (e) copy the new local parameters to the corresponding locally remembered ones to identify if a new decomposition is needed at the next call (f) return maBuffered2DDecomposition

Definition at line 62 of file BufferedDecompositionPrimitive2D.hxx.

Constructor & Destructor Documentation

◆ BufferedDecompositionPrimitive2D()

drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::BufferedDecompositionPrimitive2D ( )

Definition at line 27 of file BufferedDecompositionPrimitive2D.cxx.

Member Function Documentation

◆ create2DDecomposition()

virtual void drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::create2DDecomposition ( Primitive2DContainer rContainer,
const geometry::ViewInformation2D rViewInformation 
) const
protectedpure virtual

method which is to be used to implement the local decomposition of a 2D primitive.

Implemented in drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::TextLinePrimitive2D, drawinglayer::primitive2d::TextCharacterStrikeoutPrimitive2D, drawinglayer::primitive2d::TextGeometryStrikeoutPrimitive2D, drawinglayer::primitive2d::WallpaperBitmapPrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::BorderLinePrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::DiscreteBitmapPrimitive2D, drawinglayer::primitive2d::DiscreteShadowPrimitive2D, drawinglayer::primitive2d::Embedded3DPrimitive2D, drawinglayer::primitive2d::EpsPrimitive2D, drawinglayer::primitive2d::FillGradientPrimitive2D, drawinglayer::primitive2d::FillGraphicPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GraphicPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::HelplinePrimitive2D, drawinglayer::primitive2d::MarkerArrayPrimitive2D, drawinglayer::primitive2d::MediaPrimitive2D, drawinglayer::primitive2d::MetafilePrimitive2D, drawinglayer::primitive2d::PagePreviewPrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolygonStrokeArrowPrimitive2D, drawinglayer::primitive2d::PolygonStrokePrimitive2D, drawinglayer::primitive2d::PolygonWavePrimitive2D, drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D, drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D, drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D, drawinglayer::primitive2d::PolyPolygonHatchPrimitive2D, drawinglayer::primitive2d::PolyPolygonMarkerPrimitive2D, drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D, drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D, drawinglayer::primitive2d::ScenePrimitive2D, drawinglayer::primitive2d::SvgLinearGradientPrimitive2D, drawinglayer::primitive2d::SvgRadialGradientPrimitive2D, drawinglayer::primitive2d::SvgLinearAtomPrimitive2D, drawinglayer::primitive2d::SvgRadialAtomPrimitive2D, drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D, drawinglayer::primitive2d::TextSimplePortionPrimitive2D, and drawinglayer::primitive2d::WrongSpellPrimitive2D.

Referenced by get2DDecomposition().

◆ get2DDecomposition()

void drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition ( Primitive2DDecompositionVisitor rVisitor,
const geometry::ViewInformation2D rViewInformation 
) const
overridevirtual

The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2DDecomposition is empty.

It will set maBuffered2DDecomposition to this obtained decomposition to buffer it. If the decomposition is also ViewInformation2D-dependent, this method needs to be overridden and the ViewInformation2D for the last decomposition need to be remembered, too, and be used in the next call to decide if the buffered decomposition may be reused or not.

Reimplemented from drawinglayer::primitive2d::BasePrimitive2D.

Reimplemented in drawinglayer::primitive2d::TextEffectPrimitive2D, drawinglayer::primitive2d::BackgroundColorPrimitive2D, drawinglayer::primitive2d::ControlPrimitive2D, drawinglayer::primitive2d::FillHatchPrimitive2D, drawinglayer::primitive2d::GridPrimitive2D, drawinglayer::primitive2d::HelplinePrimitive2D, drawinglayer::primitive2d::PatternFillPrimitive2D, drawinglayer::primitive2d::PolygonMarkerPrimitive2D, drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D, drawinglayer::primitive2d::ViewportDependentPrimitive2D, drawinglayer::primitive2d::ViewTransformationDependentPrimitive2D, drawinglayer::primitive2d::ObjectAndViewTransformationDependentPrimitive2D, and drawinglayer::primitive2d::ScenePrimitive2D.

Definition at line 29 of file BufferedDecompositionPrimitive2D.cxx.

References create2DDecomposition(), getBuffered2DDecomposition(), setBuffered2DDecomposition(), and drawinglayer::primitive2d::Primitive2DDecompositionVisitor::visit().

Referenced by drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), drawinglayer::primitive2d::TextEffectPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::BackgroundColorPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::ControlPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::FillHatchPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::GridPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::HelplinePrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::PatternFillPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::PolygonMarkerPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::ViewportDependentPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::ViewTransformationDependentPrimitive2D::get2DDecomposition(), drawinglayer::primitive2d::ObjectAndViewTransformationDependentPrimitive2D::get2DDecomposition(), and drawinglayer::primitive2d::ScenePrimitive2D::get2DDecomposition().

◆ getBuffered2DDecomposition()

const Primitive2DContainer & drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::getBuffered2DDecomposition ( ) const
inlineprotected

◆ getTransparenceForShadow()

sal_uInt16 drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::getTransparenceForShadow ( ) const
inline

Definition at line 110 of file BufferedDecompositionPrimitive2D.hxx.

◆ setBuffered2DDecomposition()

void drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::setBuffered2DDecomposition ( Primitive2DContainer &&  rNew)
inlineprotected

◆ setTransparenceForShadow()

void drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::setTransparenceForShadow ( sal_uInt16  nTransparenceForShadow)
inline

Definition at line 105 of file BufferedDecompositionPrimitive2D.hxx.

Member Data Documentation

◆ maBuffered2DDecomposition

Primitive2DContainer drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::maBuffered2DDecomposition
private

a sequence used for buffering the last create2DDecomposition() result

Definition at line 66 of file BufferedDecompositionPrimitive2D.hxx.

◆ mnTransparenceForShadow

sal_uInt16 drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::mnTransparenceForShadow = 0
private

When a shadow wraps a list of primitives, this primitive wants to influence the transparency of the shadow.

Definition at line 70 of file BufferedDecompositionPrimitive2D.hxx.


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