summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-08-15 10:55:23 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-08-17 09:51:25 +0200
commit3e79151fa2552edd2e58c246d136f1fd0b2a4c86 (patch)
tree3c46f11c0c71b29765499aadbf6fc2d7d5e41ba6 /src/gui/painting
parent22b3486f82fab7aff08dabafca582ce2e248e302 (diff)
QBezier: inline fromPoints()
There's really no reason for it to be out-of-line, and we're going to use it in QBezier::split(), which is inline, and we want the optimizer to have a field day with the source, without a compiler firewall in the way. Change-Id: I49ae3a87fcce1e2dc87a9081f567503e5a98ef6b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbezier.cpp18
-rw-r--r--src/gui/painting/qbezier_p.h3
2 files changed, 2 insertions, 19 deletions
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 8cda4b4072..daf19fffe1 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -54,24 +54,6 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QBezier QBezier::fromPoints(const QPointF &p1, const QPointF &p2,
- const QPointF &p3, const QPointF &p4)
-{
- QBezier b;
- b.x1 = p1.x();
- b.y1 = p1.y();
- b.x2 = p2.x();
- b.y2 = p2.y();
- b.x3 = p3.x();
- b.y3 = p3.y();
- b.x4 = p4.x();
- b.y4 = p4.y();
- return b;
-}
-
-/*!
- \internal
-*/
QPolygonF QBezier::toPolygon(qreal bezier_flattening_threshold) const
{
// flattening is done by splitting the bezier until we can replace the segment by a straight
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h
index f8a91e9ef3..f88e3b35b3 100644
--- a/src/gui/painting/qbezier_p.h
+++ b/src/gui/painting/qbezier_p.h
@@ -69,7 +69,8 @@ class Q_GUI_EXPORT QBezier
{
public:
static QBezier fromPoints(const QPointF &p1, const QPointF &p2,
- const QPointF &p3, const QPointF &p4);
+ const QPointF &p3, const QPointF &p4)
+ { return {p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()}; }
static void coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal &d);