diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-06-16 13:00:30 (GMT) |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2009-06-16 13:00:30 (GMT) |
commit | a8681ccaf3d77b62bbc61541911d50aabc37408e (patch) | |
tree | d5ef91ae3ad3472808c3d6d5bea1e8ee7952b23d | |
parent | df792f3f790e677552ea950b039d8f8e491180bf (diff) | |
download | Qt-a8681ccaf3d77b62bbc61541911d50aabc37408e.zip Qt-a8681ccaf3d77b62bbc61541911d50aabc37408e.tar.gz Qt-a8681ccaf3d77b62bbc61541911d50aabc37408e.tar.bz2 |
smaller optimisation in ::fromTransform() and fromScale()
We know the type of the transformation in these methods, so there is no
point in setting a dirty flag for the type.
Reviewed-by: Samuel
-rw-r--r-- | src/gui/painting/qtransform.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 7ca3b79..5b498fa 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -438,9 +438,10 @@ QTransform QTransform::fromTranslate(qreal dx, qreal dy) { QTransform transform(1, 0, 0, 0, 1, 0, dx, dy, 1, true); if (dx == 0 && dy == 0) - transform.m_dirty = TxNone; + transform.m_type = TxNone; else - transform.m_dirty = TxTranslate; + transform.m_type = TxTranslate; + transform.m_dirty = TxNone; return transform; } @@ -491,9 +492,10 @@ QTransform QTransform::fromScale(qreal sx, qreal sy) { QTransform transform(sx, 0, 0, 0, sy, 0, 0, 0, 1, true); if (sx == 1. && sy == 1.) - transform.m_dirty = TxNone; + transform.m_type = TxNone; else - transform.m_dirty = TxScale; + transform.m_type = TxScale; + transform.m_dirty = TxNone; return transform; } |