aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/shapes/qquickshape_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-07-31 14:59:04 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-07-31 13:57:11 +0000
commite26ac7911613cb9c572b81820e427fbd0a5874f6 (patch)
treecc3d97c5e1c3dfa239f7bb364a44d9572d3e5075 /src/imports/shapes/qquickshape_p_p.h
parent5e8347fdbab98d721f031634a9f6c8b217072d34 (diff)
shapes: Rip out more JS API leftovers
None of the removed code is ever hit in practice since the public JS API has been removed some time ago. Let's follow it up with removing the internal details since such an API is not going to come back in the near future. Change-Id: I721ab296a7a2acb3a5f61ce705da7aa66d3ad765 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/shapes/qquickshape_p_p.h')
-rw-r--r--src/imports/shapes/qquickshape_p_p.h103
1 files changed, 18 insertions, 85 deletions
diff --git a/src/imports/shapes/qquickshape_p_p.h b/src/imports/shapes/qquickshape_p_p.h
index dc62994af2..6ca752de56 100644
--- a/src/imports/shapes/qquickshape_p_p.h
+++ b/src/imports/shapes/qquickshape_p_p.h
@@ -62,39 +62,6 @@ QT_BEGIN_NAMESPACE
class QSGPlainTexture;
-struct QQuickShapePathCommands
-{
- enum Command {
- MoveTo,
- LineTo,
- QuadTo,
- CubicTo,
- ArcTo
- };
-
- QVector<Command> cmd;
- QVector<float> coords;
-
- QPainterPath toPainterPath() const;
-};
-
-struct QQuickShapeStrokeFillParams
-{
- QQuickShapeStrokeFillParams();
-
- QColor strokeColor;
- qreal strokeWidth;
- QColor fillColor;
- QQuickShapePath::FillRule fillRule;
- QQuickShapePath::JoinStyle joinStyle;
- int miterLimit;
- QQuickShapePath::CapStyle capStyle;
- QQuickShapePath::StrokeStyle strokeStyle;
- qreal dashOffset;
- QVector<qreal> dashPattern;
- QQuickShapeGradient *fillGradient;
-};
-
class QQuickAbstractPathRenderer
{
public:
@@ -110,11 +77,7 @@ public:
virtual void endSync(bool async) = 0;
virtual void setAsyncCallback(void (*)(void *), void *) { }
virtual Flags flags() const { return 0; }
- // - QML API
virtual void setPath(int index, const QQuickPath *path) = 0;
- // - JS API
- virtual void setJSPath(int index, const QQuickShapePathCommands &path) = 0;
- // - stroke/fill parameters
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;
@@ -131,6 +94,23 @@ public:
Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAbstractPathRenderer::Flags)
+struct QQuickShapeStrokeFillParams
+{
+ QQuickShapeStrokeFillParams();
+
+ QColor strokeColor;
+ qreal strokeWidth;
+ QColor fillColor;
+ QQuickShapePath::FillRule fillRule;
+ QQuickShapePath::JoinStyle joinStyle;
+ int miterLimit;
+ QQuickShapePath::CapStyle capStyle;
+ QQuickShapePath::StrokeStyle strokeStyle;
+ qreal dashOffset;
+ QVector<qreal> dashPattern;
+ QQuickShapeGradient *fillGradient;
+};
+
class QQuickShapePathPrivate : public QQuickPathPrivate
{
Q_DECLARE_PUBLIC(QQuickShapePath)
@@ -182,57 +162,10 @@ public:
bool async;
QQuickShape::Status status;
QQuickAbstractPathRenderer *renderer;
-
- struct {
- QVector<QQuickShapePath *> sp;
- } qmlData;
-
- struct {
- bool isValid() const { Q_ASSERT(paths.count() == sfp.count()); return !paths.isEmpty(); }
- QVector<QQuickShapePathCommands> paths;
- QVector<QQuickShapeStrokeFillParams> sfp;
- } jsData;
-
+ QVector<QQuickShapePath *> sp;
bool enableVendorExts;
};
-class QQuickShapePathObject : public QObject
-{
- Q_OBJECT
-
-public:
- QQuickShapePathObject(QObject *parent = nullptr) : QObject(parent) { }
-
- void setV4Engine(QV4::ExecutionEngine *engine);
- QV4::ReturnedValue v4value() const { return m_v4value.value(); }
-
- QQuickShapePath path;
-
- void clear();
-
-private:
- QV4::PersistentValue m_v4value;
-};
-
-class QQuickShapeStrokeFillParamsObject : public QObject
-{
- Q_OBJECT
-
-public:
- QQuickShapeStrokeFillParamsObject(QObject *parent = nullptr) : QObject(parent) { }
-
- void setV4Engine(QV4::ExecutionEngine *engine);
- QV4::ReturnedValue v4value() const { return m_v4value.value(); }
-
- QQuickShapeStrokeFillParams sfp;
- QV4::PersistentValue v4fillGradient;
-
- void clear();
-
-private:
- QV4::PersistentValue m_v4value;
-};
-
#if QT_CONFIG(opengl)
class QQuickShapeGradientCache : public QOpenGLSharedResource