diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-08-25 10:11:49 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-08-25 12:48:52 +0200 |
commit | 04d0a9626ce61b2e05a40f9562c2bcf12e234639 (patch) | |
tree | f1643f829aedc9ac51fcc260f7df2639dfe08360 /src/gui/painting | |
parent | 17f3451daa286b88a52f18c802d7b158dfb653b2 (diff) | |
parent | bdc417b3828737334723eae23097c85f70c23a33 (diff) |
Merge branch 'master' into refactor
Conflicts:
src/gui/kernel/qapplication_qpa.cpp
src/gui/kernel/qcursor_qpa.cpp
src/gui/kernel/qwindowsysteminterface_qpa.cpp
src/gui/kernel/qwindowsysteminterface_qpa.h
src/gui/kernel/qwindowsysteminterface_qpa_p.h
src/gui/text/qtextcontrol.cpp
src/plugins/platforms/wayland/wayland.pro
src/widgets/accessible/qaccessible2.h
src/widgets/widgets/qwidgetlinecontrol_p.h
Change-Id: I5e6f4eb184159dccc67e8f13673edb884d179c74
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbezier_p.h | 36 | ||||
-rw-r--r-- | src/gui/painting/qbrush.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qbrush.h | 2 |
3 files changed, 18 insertions, 28 deletions
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h index 399dd89140..f1f7eb155a 100644 --- a/src/gui/painting/qbezier_p.h +++ b/src/gui/painting/qbezier_p.h @@ -162,27 +162,27 @@ inline void QBezier::coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal & inline QPointF QBezier::pointAt(qreal t) const { -#if 1 - qreal a, b, c, d; - coefficients(t, a, b, c, d); - return QPointF(a*x1 + b*x2 + c*x3 + d*x4, a*y1 + b*y2 + c*y3 + d*y4); -#else // numerically more stable: + qreal x, y; + qreal m_t = 1. - t; - qreal a = x1*m_t + x2*t; - qreal b = x2*m_t + x3*t; - qreal c = x3*m_t + x4*t; - a = a*m_t + b*t; - b = b*m_t + c*t; - qreal x = a*m_t + b*t; - qreal a = y1*m_t + y2*t; - qreal b = y2*m_t + y3*t; - qreal c = y3*m_t + y4*t; - a = a*m_t + b*t; - b = b*m_t + c*t; - qreal y = a*m_t + b*t; + { + qreal a = x1*m_t + x2*t; + qreal b = x2*m_t + x3*t; + qreal c = x3*m_t + x4*t; + a = a*m_t + b*t; + b = b*m_t + c*t; + x = a*m_t + b*t; + } + { + qreal a = y1*m_t + y2*t; + qreal b = y2*m_t + y3*t; + qreal c = y3*m_t + y4*t; + a = a*m_t + b*t; + b = b*m_t + c*t; + y = a*m_t + b*t; + } return QPointF(x, y); -#endif } inline QPointF QBezier::normalVector(qreal t) const diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 429ed0b25b..05f191dac6 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -1538,14 +1538,6 @@ bool QGradient::operator==(const QGradient &gradient) const } /*! - \internal -*/ -bool QGradient::operator==(const QGradient &gradient) -{ - return const_cast<const QGradient *>(this)->operator==(gradient); -} - -/*! \class QLinearGradient \ingroup painting diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index 00c0ebfa3a..edb092c035 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -239,8 +239,6 @@ public: inline bool operator!=(const QGradient &other) const { return !operator==(other); } - bool operator==(const QGradient &gradient); // ### Qt 5: remove - private: friend class QLinearGradient; friend class QRadialGradient; |