5#include <private/qquickpath_p_p.h>
11 if (m_sp.size() != totalCount) {
12 m_sp.resize(totalCount);
16 *countChanged =
false;
22 ShapePathGuiData &
d(m_sp[
index]);
30 ShapePathGuiData &
d(m_sp[
index]);
38 ShapePathGuiData &
d(m_sp[
index]);
48 ShapePathGuiData &
d(m_sp[
index]);
57 ShapePathGuiData &
d(m_sp[
index]);
65 ShapePathGuiData &
d(m_sp[
index]);
67 d.pen.setMiterLimit(miterLimit);
74 ShapePathGuiData &
d(m_sp[
index]);
83 ShapePathGuiData &
d(m_sp[
index]);
84 switch (strokeStyle) {
90 d.pen.setDashPattern(dashPattern);
91 d.pen.setDashOffset(dashOffset);
102 painterGradient->
setStops(
g.gradientStops());
103 switch (
g.spread()) {
120 ShapePathGuiData &
d(m_sp[
index]);
124 d.brush =
QBrush(painterGradient);
127 g->focalX(),
g->focalY(),
g->focalRadius());
129 d.brush =
QBrush(painterGradient);
133 d.brush =
QBrush(painterGradient);
156 const int count = m_sp.size();
157 const bool listChanged = m_accDirty &
DirtyList;
159 m_node->m_sp.resize(
count);
161 m_node->m_boundingRect =
QRectF();
164 ShapePathGuiData &
src(m_sp[
i]);
165 QQuickShapeSoftwareRenderNode::ShapePathRenderData &
dst(m_node->m_sp[
i]);
169 dst.path.setFillRule(
src.fillRule);
173 dst.path.setFillRule(
src.fillRule);
177 dst.strokeWidth =
src.strokeWidth;
186 const float sw =
qMax(1.0f,
dst.strokeWidth);
187 br.
adjust(-sw, -sw, sw, sw);
188 m_node->m_boundingRect |= br;
219 if (clipRegion && !clipRegion->
isEmpty())
222 p->setTransform(
matrix()->toTransform());
225 for (
const ShapePathRenderData &
d : std::as_const(m_sp)) {
244 return m_boundingRect;
The QColor class provides colors based on RGB, HSV or CMYK values.
void setSpread(Spread spread)
Specifies the spread method that should be used for this gradient.
void setStops(const QGradientStops &stops)
Replaces the current set of stop points with the given stopPoints.
The QPainter class performs low-level painting on widgets and other paint devices.
QQuickWindow * window() const
Returns the window in which this item is rendered.
RenderingFlags flags() const override
QRectF rect() const override
void releaseResources() override
This function is called when all custom graphics resources allocated by this node have to be freed im...
~QQuickShapeSoftwareRenderNode()
void render(const RenderState *state) override
This function is called by the renderer and should paint this node with directly invoking commands in...
QQuickShapeSoftwareRenderNode(QQuickShape *item)
StateFlags changedStates() const override
When the underlying rendering API is OpenGL, this function should return a mask where each bit repres...
void setStrokeColor(int index, const QColor &color) override
void setJoinStyle(int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit) override
void setFillColor(int index, const QColor &color) override
void endSync(bool async) override
void setNode(QQuickShapeSoftwareRenderNode *node)
void setStrokeStyle(int index, QQuickShapePath::StrokeStyle strokeStyle, qreal dashOffset, const QVector< qreal > &dashPattern) override
void beginSync(int totalCount, bool *countChanged) override
void setCapStyle(int index, QQuickShapePath::CapStyle capStyle) override
void setPath(int index, const QQuickPath *path) override
void setFillGradient(int index, QQuickShapeGradient *gradient) override
void updateNode() override
void setFillRule(int index, QQuickShapePath::FillRule fillRule) override
void setStrokeWidth(int index, qreal w) override
\inmodule QtCore\reentrant
constexpr void adjust(qreal x1, qreal y1, qreal x2, qreal y2) noexcept
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
The QRegion class specifies a clip region for a painter.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
qreal inheritedOpacity() const
const QMatrix4x4 * matrix() const
An interface providing access to some of the graphics API specific internals of the scenegraph.
virtual void * getResource(QQuickWindow *window, Resource resource) const
Queries a graphics resource in window.
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLenum GLsizei count
GLsizei const GLchar *const * path
static void setupPainterGradient(QGradient *painterGradient, const QQuickShapeGradient &g)