aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-13 15:21:19 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-13 15:48:30 +0000
commitc226d281975e933c69e56da7a54e9f2b8c7107b6 (patch)
tree2f3b31b04b1ab4e4cddb3b6dc134f1dac7efb329
parent4267fd4fa1e98557056c643d39fc276dc48091dd (diff)
PySide6: Fix performance of QPainter::drawPoints(QPolygon)
Reorder the overloads so that the QPolygon overload is checked first before the costly sequence type check of the QPoint list. Speeds up the example from 1800ms to 80ms. Fixes: PYSIDE-1540 Change-Id: I108b0e98c82540703ee80345026ecdc3b55dfd4e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit ef707d2077862933b767bccf17ca0c54f9475de0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml9
1 files changed, 7 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
index c8a9b2be2..6137c248f 100644
--- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml
@@ -1766,18 +1766,23 @@
<modify-function signature="drawRects(const QRect*,int)" remove="all"/>
<modify-function signature="drawRects(const QRectF*,int)" remove="all"/>
<!-- ### -->
+ <!-- PYSIDE-1540: Preferably use the QPolygon overloads first to avoid
+ a costly sequence type check on QPolygon. -->
<modify-function signature="drawPoints(const QPoint*,int)" remove="all"/>
- <add-function signature="drawPoints(QVector&lt;QPoint>)">
+ <add-function signature="drawPoints(QList&lt;QPoint>)" overload-number="2">
<inject-code>
<insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
<modify-function signature="drawPoints(const QPointF*,int)" remove="all"/>
- <add-function signature="drawPoints(QVector&lt;QPointF>)">
+ <add-function signature="drawPoints(QList&lt;QPointF>)" overload-number="3">
<inject-code>
<insert-template name="qpainter_drawlist"/>
</inject-code>
</add-function>
+ <modify-function signature="drawPoints(const QPolygon&amp;)" overload-number="0"/>
+ <modify-function signature="drawPoints(const QPolygonF&amp;)" overload-number="1"/>
+
<modify-function signature="drawPolygon(const QPoint*,int,Qt::FillRule)" remove="all"/>
<add-function signature="drawPolygon(QVector&lt;QPoint>,Qt::FillRule)">
<inject-code file="../glue/qtgui.cpp" snippet="qpainter-drawpolygon"/>