diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-06 07:25:10 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-06 08:55:40 (GMT) |
commit | abb62219db97cc77da16a9b12aa833bdcf8ae476 (patch) | |
tree | e66a4b644a7586d17036dd9c4122e23f5d30a34e /src/gui/painting/qblendfunctions_p.h | |
parent | 90bc27ebe4dc59c3966ba9b3b18fa209e24afd7d (diff) | |
download | Qt-abb62219db97cc77da16a9b12aa833bdcf8ae476.zip Qt-abb62219db97cc77da16a9b12aa833bdcf8ae476.tar.gz Qt-abb62219db97cc77da16a9b12aa833bdcf8ae476.tar.bz2 |
Get rid of double conversions and arithmetic when qreal is float.
Task-number: QT-4624
Reviewed-by: Kim
Diffstat (limited to 'src/gui/painting/qblendfunctions_p.h')
-rw-r--r-- | src/gui/painting/qblendfunctions_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 8aff912..81f8b70 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -275,8 +275,8 @@ void qt_transform_image_rasterize(DestT *destPixels, int dbpl, qreal rightSlope = (bottomRight.x - topRight.x) / (bottomRight.y - topRight.y); int dx_l = int(leftSlope * 0x10000); int dx_r = int(rightSlope * 0x10000); - int x_l = int((topLeft.x + (0.5 + fromY - topLeft.y) * leftSlope + 0.5) * 0x10000); - int x_r = int((topRight.x + (0.5 + fromY - topRight.y) * rightSlope + 0.5) * 0x10000); + int x_l = int((topLeft.x + (qreal(0.5) + fromY - topLeft.y) * leftSlope + qreal(0.5)) * 0x10000); + int x_r = int((topRight.x + (qreal(0.5) + fromY - topRight.y) * rightSlope + qreal(0.5)) * 0x10000); int fromX, toX, x1, x2, u, v, i, ii; DestT *line; @@ -471,8 +471,8 @@ void qt_transform_image(DestT *destPixels, int dbpl, int dvdx = int(m21 * 0x10000); int dudy = int(m12 * 0x10000); int dvdy = int(m22 * 0x10000); - int u0 = qCeil((0.5 * m11 + 0.5 * m12 + mdx) * 0x10000) - 1; - int v0 = qCeil((0.5 * m21 + 0.5 * m22 + mdy) * 0x10000) - 1; + int u0 = qCeil((qreal(0.5) * m11 + qreal(0.5) * m12 + mdx) * 0x10000) - 1; + int v0 = qCeil((qreal(0.5) * m21 + qreal(0.5) * m22 + mdy) * 0x10000) - 1; int x1 = qFloor(sourceRect.left()); int y1 = qFloor(sourceRect.top()); |