aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes/qquickshapecurverenderer_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickshapes/qquickshapecurverenderer_p.h')
-rw-r--r--src/quickshapes/qquickshapecurverenderer_p.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/quickshapes/qquickshapecurverenderer_p.h b/src/quickshapes/qquickshapecurverenderer_p.h
index a6f80824fd..a664b5efb4 100644
--- a/src/quickshapes/qquickshapecurverenderer_p.h
+++ b/src/quickshapes/qquickshapecurverenderer_p.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 The Qt Company Ltd.
+// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQUICKSHAPECURVERENDERER_P_H
@@ -55,10 +55,12 @@ public:
void setStrokeStyle(int index, QQuickShapePath::StrokeStyle strokeStyle,
qreal dashOffset, const QVector<qreal> &dashPattern) override;
void setFillGradient(int index, QQuickShapeGradient *gradient) override;
+ void setFillTextureProvider(int index, QQuickItem *textureProviderItem) override;
void setFillTransform(int index, const QSGTransform &transform) override;
void endSync(bool async) override;
void setAsyncCallback(void (*)(void *), void *) override;
Flags flags() const override { return SupportsAsync; }
+ void handleSceneChange(QQuickWindow *window) override;
void updateNode() override;
@@ -86,7 +88,12 @@ public:
private:
struct PathData {
- bool isFillVisible() const { return fillColor.alpha() > 0 || gradientType != QGradient::NoGradient; }
+ bool isFillVisible() const
+ {
+ return gradientType != QGradient::NoGradient
+ || fillTextureProviderItem != nullptr
+ || fillColor.alpha() > 0;
+ }
bool isStrokeVisible() const
{
@@ -112,13 +119,14 @@ private:
NodeList strokeNodes;
QQuickShapeCurveRunnable *currentRunner = nullptr;
+ QQuickItem *fillTextureProviderItem = nullptr;
};
void createRunner(PathData *pathData);
void maybeUpdateAsyncItem();
static void processPath(PathData *pathData);
- static NodeList addFillNodes(const PathData &pathData);
+ static NodeList addFillNodes(const QQuadPath &path);
static NodeList addTriangulatingStrokerNodes(const PathData &pathData);
static NodeList addCurveStrokeNodes(const PathData &pathData);