aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-13 15:21:19 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-14 13:35:08 +0200
commitd47736aef4794c4eb81199d71f82ec1ebaced6cf (patch)
treef084ab620314a3865f4b3aecc161dc9227b04f34 /sources
parent7e1f66cd048722f2118a9e8ddbe6f481c68840ca (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)
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml9
1 files changed, 7 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index e55d40eb9..b0c61fe64 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -1871,18 +1871,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(QVector&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(QVector&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"/>