aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-16 16:25:06 +0100
commit1d333d3375874efb8d37df37dc5ef561573794ad (patch)
tree2d8c995f64c05c84c1fcceb2c5cb40fcae69855f /src/quickshapes
parentb106d86c433706928b0b0c206a0d9f831681e1bf (diff)
parente79a2658cde899d6ee11ec3c0d0a3768eb2c864b (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'src/quickshapes')
-rw-r--r--src/quickshapes/qquickshape.cpp24
-rw-r--r--src/quickshapes/qquickshape_p.h6
-rw-r--r--src/quickshapes/qquickshape_p_p.h2
-rw-r--r--src/quickshapes/qquickshapegenericrenderer.cpp6
-rw-r--r--src/quickshapes/qquickshapesoftwarerenderer.cpp2
-rw-r--r--src/quickshapes/quickshapes.pro6
-rw-r--r--src/quickshapes/shaders_ng/conicalgradient.frag.qsbbin2228 -> 1889 bytes
-rw-r--r--src/quickshapes/shaders_ng/conicalgradient.vert.qsbbin1994 -> 1684 bytes
-rw-r--r--src/quickshapes/shaders_ng/lineargradient.frag.qsbbin1762 -> 1423 bytes
-rw-r--r--src/quickshapes/shaders_ng/lineargradient.vert.qsbbin2225 -> 1895 bytes
-rw-r--r--src/quickshapes/shaders_ng/radialgradient.frag.qsbbin2931 -> 2579 bytes
-rw-r--r--src/quickshapes/shaders_ng/radialgradient.vert.qsbbin2115 -> 1774 bytes
12 files changed, 24 insertions, 22 deletions
diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp
index a7db65f16f..563303b84a 100644
--- a/src/quickshapes/qquickshape.cpp
+++ b/src/quickshapes/qquickshape.cpp
@@ -49,12 +49,12 @@
#include <QLoggingCategory>
#include <QtGui/private/qrhi_p.h>
-#if defined(QT_STATIC)
static void initResources()
{
+#if defined(QT_STATIC)
Q_INIT_RESOURCE(qtquickshapes);
-}
#endif
+}
QT_BEGIN_NAMESPACE
@@ -73,6 +73,11 @@ Q_LOGGING_CATEGORY(QQSHAPE_LOG_TIME_DIRTY_SYNC, "qt.shape.time.sync")
\endqml
*/
+void QQuickShapesModule::defineModule()
+{
+ initResources();
+}
+
QQuickShapeStrokeFillParams::QQuickShapeStrokeFillParams()
: strokeColor(Qt::white),
strokeWidth(1),
@@ -595,8 +600,6 @@ void QQuickShapePath::resetFillGradient()
\li The \c software backend is fully supported. The path is rendered via
QPainter::strokePath() and QPainter::fillPath() in this case.
- \li The Direct 3D 12 backend is not currently supported.
-
\li The OpenVG backend is not currently supported.
\endlist
@@ -667,22 +670,9 @@ void QQuickShapePrivate::setStatus(QQuickShape::Status newStatus)
}
}
-struct QQuickShapeResourceInitializer
-{
- QQuickShapeResourceInitializer()
- {
-#if defined(QT_STATIC)
- initResources();
-#endif
- }
-};
-
-Q_GLOBAL_STATIC(QQuickShapeResourceInitializer, initQQuickShapeResources)
-
QQuickShape::QQuickShape(QQuickItem *parent)
: QQuickItem(*(new QQuickShapePrivate), parent)
{
- initQQuickShapeResources();
setFlag(ItemHasContents);
}
diff --git a/src/quickshapes/qquickshape_p.h b/src/quickshapes/qquickshape_p.h
index cadc65f7cd..f86f2b03d6 100644
--- a/src/quickshapes/qquickshape_p.h
+++ b/src/quickshapes/qquickshape_p.h
@@ -63,6 +63,12 @@ QT_BEGIN_NAMESPACE
class QQuickShapePathPrivate;
class QQuickShapePrivate;
+class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapesModule
+{
+public:
+ static void defineModule();
+};
+
class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapeGradient : public QQuickGradient
{
Q_OBJECT
diff --git a/src/quickshapes/qquickshape_p_p.h b/src/quickshapes/qquickshape_p_p.h
index bfeb0d2f9f..e9b89d2ab3 100644
--- a/src/quickshapes/qquickshape_p_p.h
+++ b/src/quickshapes/qquickshape_p_p.h
@@ -89,7 +89,7 @@ public:
virtual void beginSync(int totalCount) = 0;
virtual void endSync(bool async) = 0;
virtual void setAsyncCallback(void (*)(void *), void *) { }
- virtual Flags flags() const { return 0; }
+ virtual Flags flags() const { return {}; }
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;
diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp
index 06cc442fc7..e0df739987 100644
--- a/src/quickshapes/qquickshapegenericrenderer.cpp
+++ b/src/quickshapes/qquickshapegenericrenderer.cpp
@@ -470,14 +470,14 @@ void QQuickShapeGenericRenderer::triangulateStroke(const QPainterPath &path,
stroker.setInvScale(inverseScale);
if (pen.style() == Qt::SolidLine) {
- stroker.process(vp, pen, clip, nullptr);
+ stroker.process(vp, pen, clip, {});
} else {
QDashedStrokeProcessor dashStroker;
dashStroker.setInvScale(inverseScale);
- dashStroker.process(vp, pen, clip, nullptr);
+ dashStroker.process(vp, pen, clip, {});
QVectorPath dashStroke(dashStroker.points(), dashStroker.elementCount(),
dashStroker.elementTypes(), 0);
- stroker.process(dashStroke, pen, clip, nullptr);
+ stroker.process(dashStroke, pen, clip, {});
}
if (!stroker.vertexCount()) {
diff --git a/src/quickshapes/qquickshapesoftwarerenderer.cpp b/src/quickshapes/qquickshapesoftwarerenderer.cpp
index 0f5c3604b5..d6a9d85643 100644
--- a/src/quickshapes/qquickshapesoftwarerenderer.cpp
+++ b/src/quickshapes/qquickshapesoftwarerenderer.cpp
@@ -266,7 +266,7 @@ void QQuickShapeSoftwareRenderNode::render(const RenderState *state)
QSGRenderNode::StateFlags QQuickShapeSoftwareRenderNode::changedStates() const
{
- return nullptr;
+ return {};
}
QSGRenderNode::RenderingFlags QQuickShapeSoftwareRenderNode::flags() const
diff --git a/src/quickshapes/quickshapes.pro b/src/quickshapes/quickshapes.pro
index 5a59dec18e..7c71aa4f4a 100644
--- a/src/quickshapes/quickshapes.pro
+++ b/src/quickshapes/quickshapes.pro
@@ -31,3 +31,9 @@ qtConfig(opengl) {
RESOURCES += qtquickshapes.qrc
load(qt_module)
+
+QMLTYPES_FILENAME = plugins.qmltypes
+QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Shapes
+QML_IMPORT_NAME = QtQuick.Shapes
+IMPORT_VERSION = 1.15
+CONFIG += qmltypes install_qmltypes install_metatypes
diff --git a/src/quickshapes/shaders_ng/conicalgradient.frag.qsb b/src/quickshapes/shaders_ng/conicalgradient.frag.qsb
index 9aa59ca651..cee844fab4 100644
--- a/src/quickshapes/shaders_ng/conicalgradient.frag.qsb
+++ b/src/quickshapes/shaders_ng/conicalgradient.frag.qsb
Binary files differ
diff --git a/src/quickshapes/shaders_ng/conicalgradient.vert.qsb b/src/quickshapes/shaders_ng/conicalgradient.vert.qsb
index 7f5985ef64..50508e242a 100644
--- a/src/quickshapes/shaders_ng/conicalgradient.vert.qsb
+++ b/src/quickshapes/shaders_ng/conicalgradient.vert.qsb
Binary files differ
diff --git a/src/quickshapes/shaders_ng/lineargradient.frag.qsb b/src/quickshapes/shaders_ng/lineargradient.frag.qsb
index 470de007b5..d25d5e7a79 100644
--- a/src/quickshapes/shaders_ng/lineargradient.frag.qsb
+++ b/src/quickshapes/shaders_ng/lineargradient.frag.qsb
Binary files differ
diff --git a/src/quickshapes/shaders_ng/lineargradient.vert.qsb b/src/quickshapes/shaders_ng/lineargradient.vert.qsb
index 8d054efbb4..c48646b036 100644
--- a/src/quickshapes/shaders_ng/lineargradient.vert.qsb
+++ b/src/quickshapes/shaders_ng/lineargradient.vert.qsb
Binary files differ
diff --git a/src/quickshapes/shaders_ng/radialgradient.frag.qsb b/src/quickshapes/shaders_ng/radialgradient.frag.qsb
index 166eb2f92d..207e4d3429 100644
--- a/src/quickshapes/shaders_ng/radialgradient.frag.qsb
+++ b/src/quickshapes/shaders_ng/radialgradient.frag.qsb
Binary files differ
diff --git a/src/quickshapes/shaders_ng/radialgradient.vert.qsb b/src/quickshapes/shaders_ng/radialgradient.vert.qsb
index 293e23947a..dadbfd60d6 100644
--- a/src/quickshapes/shaders_ng/radialgradient.vert.qsb
+++ b/src/quickshapes/shaders_ng/radialgradient.vert.qsb
Binary files differ