Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQuickShapeGenericRenderer Class Reference

#include <qquickshapegenericrenderer_p.h>

+ Inheritance diagram for QQuickShapeGenericRenderer:
+ Collaboration diagram for QQuickShapeGenericRenderer:

Classes

struct  Color4ub
 

Public Types

enum  Dirty {
  DirtyFillGeom = 0x01 , DirtyStrokeGeom = 0x02 , DirtyColor = 0x04 , DirtyFillGradient = 0x08 ,
  DirtyList = 0x10
}
 
typedef QVector< QSGGeometry::ColoredPoint2DVertexContainerType
 
typedef QVector< quint32IndexContainerType
 
- Public Types inherited from QQuickAbstractPathRenderer
enum  Flag { SupportsAsync = 0x01 }
 
enum  FillGradientType { NoGradient = 0 , LinearGradient , RadialGradient , ConicalGradient }
 

Public Member Functions

 QQuickShapeGenericRenderer (QQuickItem *item)
 
 ~QQuickShapeGenericRenderer ()
 
void beginSync (int totalCount, bool *countChanged) override
 
void setPath (int index, const QQuickPath *path) override
 
void setStrokeColor (int index, const QColor &color) override
 
void setStrokeWidth (int index, qreal w) override
 
void setFillColor (int index, const QColor &color) override
 
void setFillRule (int index, QQuickShapePath::FillRule fillRule) override
 
void setJoinStyle (int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit) override
 
void setCapStyle (int index, QQuickShapePath::CapStyle capStyle) override
 
void setStrokeStyle (int index, QQuickShapePath::StrokeStyle strokeStyle, qreal dashOffset, const QVector< qreal > &dashPattern) override
 
void setFillGradient (int index, QQuickShapeGradient *gradient) override
 
void setTriangulationScale (qreal scale) override
 
void endSync (bool async) override
 
void setAsyncCallback (void(*)(void *), void *) override
 
Flags flags () const override
 
void updateNode () override
 
void setRootNode (QQuickShapeGenericNode *node)
 
- Public Member Functions inherited from QQuickAbstractPathRenderer
virtual ~QQuickAbstractPathRenderer ()
 
virtual void beginSync (int totalCount, bool *countChanged)=0
 
virtual void endSync (bool async)=0
 
virtual void setAsyncCallback (void(*)(void *), void *)
 
virtual Flags flags () const
 
virtual void setPath (int index, const QQuickPath *path)=0
 
virtual void setStrokeColor (int index, const QColor &color)=0
 
virtual void setStrokeWidth (int index, qreal w)=0
 
virtual void setFillColor (int index, const QColor &color)=0
 
virtual void setFillRule (int index, QQuickShapePath::FillRule fillRule)=0
 
virtual void setJoinStyle (int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit)=0
 
virtual void setCapStyle (int index, QQuickShapePath::CapStyle capStyle)=0
 
virtual void setStrokeStyle (int index, QQuickShapePath::StrokeStyle strokeStyle, qreal dashOffset, const QVector< qreal > &dashPattern)=0
 
virtual void setFillGradient (int index, QQuickShapeGradient *gradient)=0
 
virtual void setTriangulationScale (qreal)
 
virtual void updateNode ()=0
 

Static Public Member Functions

static void triangulateFill (const QPainterPath &path, const Color4ub &fillColor, VertexContainerType *fillVertices, IndexContainerType *fillIndices, QSGGeometry::Type *indexType, bool supportsElementIndexUint, qreal triangulationScale)
 
static void triangulateStroke (const QPainterPath &path, const QPen &pen, const Color4ub &strokeColor, VertexContainerType *strokeVertices, const QSize &clipSize, qreal triangulationScale)
 

Detailed Description

Definition at line 34 of file qquickshapegenericrenderer_p.h.

Member Typedef Documentation

◆ IndexContainerType

◆ VertexContainerType

Member Enumeration Documentation

◆ Dirty

Enumerator
DirtyFillGeom 
DirtyStrokeGeom 
DirtyColor 
DirtyFillGradient 
DirtyList 

Definition at line 37 of file qquickshapegenericrenderer_p.h.

Constructor & Destructor Documentation

◆ QQuickShapeGenericRenderer()

QQuickShapeGenericRenderer::QQuickShapeGenericRenderer ( QQuickItem item)
inline

Definition at line 45 of file qquickshapegenericrenderer_p.h.

◆ ~QQuickShapeGenericRenderer()

QQuickShapeGenericRenderer::~QQuickShapeGenericRenderer ( )

Definition at line 76 of file qquickshapegenericrenderer.cpp.

References d.

Member Function Documentation

◆ beginSync()

void QQuickShapeGenericRenderer::beginSync ( int  totalCount,
bool *  countChanged 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 89 of file qquickshapegenericrenderer.cpp.

References d, and DirtyList.

◆ endSync()

◆ flags()

Flags QQuickShapeGenericRenderer::flags ( ) const
inlineoverridevirtual

◆ setAsyncCallback()

void QQuickShapeGenericRenderer::setAsyncCallback ( void(*)(void *)  callback,
void data 
)
overridevirtual

Reimplemented from QQuickAbstractPathRenderer.

Definition at line 222 of file qquickshapegenericrenderer.cpp.

◆ setCapStyle()

void QQuickShapeGenericRenderer::setCapStyle ( int  index,
QQuickShapePath::CapStyle  capStyle 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 155 of file qquickshapegenericrenderer.cpp.

References d, and DirtyStrokeGeom.

◆ setFillColor()

void QQuickShapeGenericRenderer::setFillColor ( int  index,
const QColor color 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 129 of file qquickshapegenericrenderer.cpp.

References colorToColor4ub(), d, DirtyColor, and DirtyFillGeom.

+ Here is the call graph for this function:

◆ setFillGradient()

void QQuickShapeGenericRenderer::setFillGradient ( int  index,
QQuickShapeGradient gradient 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 174 of file qquickshapegenericrenderer.cpp.

References QQuickAbstractPathRenderer::ConicalGradient, d, DirtyFillGradient, QQuickGradient::gradientStops(), QQuickAbstractPathRenderer::LinearGradient, QQuickAbstractPathRenderer::NoGradient, QQuickAbstractPathRenderer::RadialGradient, and QQuickShapeGradient::spread.

+ Here is the call graph for this function:

◆ setFillRule()

void QQuickShapeGenericRenderer::setFillRule ( int  index,
QQuickShapePath::FillRule  fillRule 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 140 of file qquickshapegenericrenderer.cpp.

References d, and DirtyFillGeom.

◆ setJoinStyle()

void QQuickShapeGenericRenderer::setJoinStyle ( int  index,
QQuickShapePath::JoinStyle  joinStyle,
int  miterLimit 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 147 of file qquickshapegenericrenderer.cpp.

References d, and DirtyStrokeGeom.

◆ setPath()

void QQuickShapeGenericRenderer::setPath ( int  index,
const QQuickPath path 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 102 of file qquickshapegenericrenderer.cpp.

References d, DirtyFillGeom, and DirtyStrokeGeom.

◆ setRootNode()

void QQuickShapeGenericRenderer::setRootNode ( QQuickShapeGenericNode node)

Definition at line 454 of file qquickshapegenericrenderer.cpp.

References DirtyList.

◆ setStrokeColor()

void QQuickShapeGenericRenderer::setStrokeColor ( int  index,
const QColor color 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 109 of file qquickshapegenericrenderer.cpp.

References colorToColor4ub(), d, DirtyColor, and DirtyStrokeGeom.

+ Here is the call graph for this function:

◆ setStrokeStyle()

void QQuickShapeGenericRenderer::setStrokeStyle ( int  index,
QQuickShapePath::StrokeStyle  strokeStyle,
qreal  dashOffset,
const QVector< qreal > &  dashPattern 
)
overridevirtual

◆ setStrokeWidth()

void QQuickShapeGenericRenderer::setStrokeWidth ( int  index,
qreal  w 
)
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 120 of file qquickshapegenericrenderer.cpp.

References d, and DirtyStrokeGeom.

◆ setTriangulationScale()

void QQuickShapeGenericRenderer::setTriangulationScale ( qreal  scale)
overridevirtual

Reimplemented from QQuickAbstractPathRenderer.

Definition at line 203 of file qquickshapegenericrenderer.cpp.

◆ triangulateFill()

void QQuickShapeGenericRenderer::triangulateFill ( const QPainterPath path,
const Color4ub fillColor,
VertexContainerType fillVertices,
IndexContainerType fillIndices,
QSGGeometry::Type indexType,
bool  supportsElementIndexUint,
qreal  triangulationScale 
)
static

Definition at line 383 of file qquickshapegenericrenderer.cpp.

References QList< T >::constData(), QList< T >::data(), QVertexIndexVector::data(), QTransform::fromScale(), i, QTriangleSet::indices, qTriangulate(), qtVectorPathForPath(), QList< T >::resize(), set, QVertexIndexVector::size(), QList< T >::size(), QVertexIndexVector::type(), QSGGeometry::UnsignedIntType, QVertexIndexVector::UnsignedShort, QSGGeometry::UnsignedShortType, and QTriangleSet::vertices.

Referenced by endSync(), and QQuickShapeFillRunnable::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ triangulateStroke()

void QQuickShapeGenericRenderer::triangulateStroke ( const QPainterPath path,
const QPen pen,
const Color4ub strokeColor,
VertexContainerType strokeVertices,
const QSize clipSize,
qreal  triangulationScale 
)
static

Definition at line 416 of file qquickshapegenericrenderer.cpp.

References QList< T >::clear(), QList< T >::data(), QDashedStrokeProcessor::elementCount(), QDashedStrokeProcessor::elementTypes(), i, QDashedStrokeProcessor::points(), QTriangulatingStroker::process(), QDashedStrokeProcessor::process(), qtVectorPathForPath(), QList< T >::resize(), set, QTriangulatingStroker::setInvScale(), QDashedStrokeProcessor::setInvScale(), Qt::SolidLine, QPen::style(), QTriangulatingStroker::vertexCount(), and QTriangulatingStroker::vertices().

Referenced by endSync(), and QQuickShapeStrokeRunnable::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateNode()

void QQuickShapeGenericRenderer::updateNode ( )
overridevirtual

Implements QQuickAbstractPathRenderer.

Definition at line 463 of file qquickshapegenericrenderer.cpp.

References QSGNode::appendChildNode(), d, DirtyColor, DirtyFillGeom, DirtyFillGradient, DirtyList, DirtyStrokeGeom, QQuickShapeGenericNode::m_fillNode, QQuickShapeGenericNode::m_next, QQuickShapeGenericNode::m_strokeNode, Q_ASSERT, QSGNode::removeChildNode(), and QQuickItem::window().

+ Here is the call graph for this function:

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