summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtriangulator_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-01-11 11:42:14 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-01-18 14:48:07 +0000
commit8c144298439a6537adc0d67ca03382a305484deb (patch)
treeea9d3cba25fc31aa718b883e75f23785acde94e7 /src/gui/painting/qtriangulator_p.h
parenteba886c32ff5db1a0a737d33447a1f5c97919d57 (diff)
Remove OpenGL dependency from qTriangulate
The original implementation is only suitable as long as the only client is the GL paint engine which will call the function with the GL context current. In other cases this cannot be ensured. For instance, doing triangulation on the gui thread in a Quick application using the threaded render loop will have to deal with not having a current context on that thread at all. Doing triangulation on worker threads has the same problem as well. In addition, in modern Qt versions a -no-opengl build does not imply no accelerated graphics API. Therefore, drop the ElementIndexUint check from qtriangulator.cpp and leave it up to the caller to tell if uint indices are supported or not. Change-Id: I7491d84981ee22d05c5fde08994dbb3a4e2432e9 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'src/gui/painting/qtriangulator_p.h')
-rw-r--r--src/gui/painting/qtriangulator_p.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/painting/qtriangulator_p.h b/src/gui/painting/qtriangulator_p.h
index 4d1aba099c..8f043fc925 100644
--- a/src/gui/painting/qtriangulator_p.h
+++ b/src/gui/painting/qtriangulator_p.h
@@ -137,11 +137,18 @@ struct Q_GUI_EXPORT QPolylineSet
// integers, the polygon is triangulated, and then scaled back by 1/32.
// 'hint' should be a combination of QVectorPath::Hints.
// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher.
-QTriangleSet Q_GUI_EXPORT qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform());
-QTriangleSet Q_GUI_EXPORT qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
-QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
-QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
-QPolylineSet Q_GUI_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1);
+QTriangleSet Q_GUI_EXPORT qTriangulate(const qreal *polygon, int count,
+ uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill,
+ const QTransform &matrix = QTransform(),
+ bool allowUintIndices = true);
+QTriangleSet Q_GUI_EXPORT qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(),
+ qreal lod = 1, bool allowUintIndices = true);
+QTriangleSet Q_GUI_EXPORT qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(),
+ qreal lod = 1, bool allowUintIndices = true);
+QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(),
+ qreal lod = 1, bool allowUintIndices = true);
+QPolylineSet Q_GUI_EXPORT qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(),
+ qreal lod = 1, bool allowUintIndices = true);
QT_END_NAMESPACE