summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qdrawhelper.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-28 14:33:58 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-30 08:28:41 +0000
commitffc377a5291d8c53b62de11cc4187026e0f7a6bf (patch)
tree54f5378bda6c3d6552ebbf2b311dfc595a8f3305 /src/gui/painting/qdrawhelper.cpp
parentd517d5428c30d1e9ae4b6413116ea147a8b64f3c (diff)
Reduce recent performance regression
The change to fix 16-bit integer overflow used two floor operations when only one is necessary. With floor being rather expensive on x86 without SSE4.1 this caused a performance regression in ARGB32 smooth perspective transforms. This eliminates one of the floor operations which is unnecessary as the number is always positive in this case and thus truncation will yield the same result faster. Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 17010fa3fa..34847daf55 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -3198,8 +3198,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
int y1 = qFloor(py);
int y2;
- distxs[i] = qFloor((px - x1) * (1<<16));
- distys[i] = qFloor((py - y1) * (1<<16));
+ distxs[i] = int((px - x1) * (1<<16));
+ distys[i] = int((py - y1) * (1<<16));
fetchTransformedBilinear_pixelBounds<blendType>(image.width, image.x1, image.x2 - 1, x1, x2);
fetchTransformedBilinear_pixelBounds<blendType>(image.height, image.y1, image.y2 - 1, y1, y2);