diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-12 07:32:40 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-12 07:32:40 (GMT) |
commit | 9a79b2bccba4ac80ab7b5d13d7ad3651bde06893 (patch) | |
tree | 84b599027bb34cdce1443adf78def8f305764fb5 /src/gui/painting | |
parent | 978e22d6529d7cbe9472749352d632eefd22cd07 (diff) | |
parent | 1571281bc0839cf504ac7692050ef4fe61532470 (diff) | |
download | Qt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.zip Qt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.tar.gz Qt-9a79b2bccba4ac80ab7b5d13d7ad3651bde06893.tar.bz2 |
Merge remote branch 'review/master' into staging
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbezier_p.h | 36 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 6 |
2 files changed, 20 insertions, 22 deletions
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h index 399dd89..f1f7eb1 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/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index fdba9c9..3973abd 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -198,7 +198,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const Coord c = { 0, 0, // will be filled in later glyph_width, glyph_height, // texture coords - metrics.x.round().truncate(), + metrics.x.truncate(), -metrics.y.truncate() }; // baseline for horizontal scripts listItemCoordinates.insert(key, c); @@ -367,9 +367,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { -#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) - return 1; -#elif defined(Q_WS_X11) +#if (defined(Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) || defined(Q_WS_X11) return 0; #else return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; |