aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcurveprocessor.cpp
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2024-01-15 12:40:09 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2024-01-17 15:36:26 +0100
commite7d8ebb25be6a3f11c7cf3f42660804c58650e19 (patch)
tree4cf055e75d8e57b1ceef69dd3964f04fa15d6ffe /src/quick/scenegraph/qsgcurveprocessor.cpp
parent29271134b0ff6c8a2492919cf5528713e6a2f230 (diff)
Return status of solveIntersections
Pick-to: 6.7 Change-Id: I7fc0087c4f9219ac6834008e2c49438f81aae3d9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcurveprocessor.cpp')
-rw-r--r--src/quick/scenegraph/qsgcurveprocessor.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/quick/scenegraph/qsgcurveprocessor.cpp b/src/quick/scenegraph/qsgcurveprocessor.cpp
index 6fe9b56855..29e223d49f 100644
--- a/src/quick/scenegraph/qsgcurveprocessor.cpp
+++ b/src/quick/scenegraph/qsgcurveprocessor.cpp
@@ -993,7 +993,8 @@ QList<QPair<int, int>> QSGCurveProcessor::findOverlappingCandidates(const QQuadP
return overlappingBB;
}
-void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
+// Returns true if the path was changed
+bool QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
{
struct IntersectionData { int e1; int e2; float t1; float t2; bool in1 = false, in2 = false, out1 = false, out2 = false; };
QList<IntersectionData> intersections;
@@ -1040,7 +1041,7 @@ void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
if (intersections.isEmpty() && !alwaysReorder) {
qCDebug(lcSGCurveIntersectionSolver) << "Returning the path unchanged.";
- return;
+ return false;
}
// Store the starting and end elements of the subpaths to be able
@@ -1118,7 +1119,7 @@ void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
if (!findStart(path, 0, path.elementCount(), &i1, &forward)) {
qWarning() << "No suitable start found. This should not happen. Returning the path unchanged.";
- return;
+ return false;
}
// Helper function to start a new subpath and update temporary variables.
@@ -1151,7 +1152,7 @@ void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
}
if (handledElements[nextIndex]) {
qWarning() << "Revisiting an element when trying to solve intersections. This should not happen. Returning the path unchanged.";
- return;
+ return false;
}
handledElements[nextIndex] = true;
}
@@ -1330,7 +1331,7 @@ void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
if (intersections.isEmpty()) {
qCDebug(lcSGCurveIntersectionSolver) << "All intersections handled. I am done.";
path = fixedPath;
- return;
+ return true;
}
IntersectionData &unhandledIntersec = intersections[0];
@@ -1395,7 +1396,7 @@ void QSGCurveProcessor::solveIntersections(QQuadPath &path, bool alwaysReorder)
// Check the totalIterations as a sanity check. Should never be triggered.
qWarning() << "Could not solve intersections of path. This should not happen. Returning the path unchanged.";
-
+ return false;
}