diff options
author | Kaj Grönholm <kgronholm@gmail.com> | 2017-12-16 12:00:07 +0200 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@qt.io> | 2018-02-01 06:39:24 +0000 |
commit | f5abe488f1e7c9c31badd0622b7374648bea943a (patch) | |
tree | 4ba5c8c2fdc3af666917cced5937c767bdd5e6ef /src/imports | |
parent | 07f9ca1759e35f1eb497fe2f1ad4b7ba71b69b5c (diff) |
Add optimized path for QML ShapePath
Improve performance of QML ShapePath, especially with more complex
animating paths. Testing revealed that considerable amount of time
is used for calculating QPainterPath::length(). QML ShapePath
doesn't support QQuickPathAttribute or QQuickPathPercent, so it
can have a fast-path for creating the path without calculating
length or attributes.
This gave heavy bezier lines rendering test ~7x performance boost.
Task-number: QTBUG-64951
Change-Id: I5240ed3516b5eafb0391790ac96835e70f88e540
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/shapes/qquickshape.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index 54a0a3d402..da5a525ff0 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -142,6 +142,8 @@ QQuickShapeStrokeFillParams::QQuickShapeStrokeFillParams() QQuickShapePathPrivate::QQuickShapePathPrivate() : dirty(DirtyAll) { + // Set this QQuickPath to be a ShapePath + isShapePath = true; } QQuickShapePath::QQuickShapePath(QObject *parent) |