diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-06 19:31:35 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-07 11:48:29 +0200 |
commit | c0f16df6d8ddc66afd3528f18f20c65130df3de6 (patch) | |
tree | 29779ef271457292a396bcecc70b6c95e36dfa66 /src/quickshapes/qquickshapegenericrenderer.cpp | |
parent | f500e45cc5b237b5ed549947cdf129e9cafa689c (diff) |
Shapes: only call update() when something changed
Shapes has an unusual setup where changing properties (or properties
of the Path objects) does not lead to calling update() on the Shape
item. That's why it was done in updatePolish() but that can be made
less heavy by only doing it when the shape found that something got
changed.
Task-number: QTBUG-86089
Change-Id: I74f708a960a29f26eb003ac160d2b1258b9ae50f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quickshapes/qquickshapegenericrenderer.cpp')
-rw-r--r-- | src/quickshapes/qquickshapegenericrenderer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp index 16831d59d3..c1cadb82ef 100644 --- a/src/quickshapes/qquickshapegenericrenderer.cpp +++ b/src/quickshapes/qquickshapegenericrenderer.cpp @@ -122,11 +122,14 @@ QQuickShapeGenericRenderer::~QQuickShapeGenericRenderer() // sync, and so triangulation too, happens on the gui thread // - except when async is set, in which case triangulation is moved to worker threads -void QQuickShapeGenericRenderer::beginSync(int totalCount) +void QQuickShapeGenericRenderer::beginSync(int totalCount, bool *countChanged) { if (m_sp.count() != totalCount) { m_sp.resize(totalCount); m_accDirty |= DirtyList; + *countChanged = true; + } else { + *countChanged = false; } for (ShapePathData &d : m_sp) d.syncDirty = 0; |