From 433ea5eb0c3d851f7f074f0e32db2807476a9698 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 27 Jan 2014 18:22:53 +0100 Subject: Fix performance regression in mirroring QBitmap The recent split of qimage.cpp meant mirror_horizonal_bitmap had to access the bitflip array using a function call. The function call was placed in the inner loop, but should have been moved out of the loop as it can not be inlined. Change-Id: Id771b2fb7e6c2bfa59670ee96a857a529da13c0b Reviewed-by: Gunnar Sletta --- src/gui/image/qimage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 305595b68e..9fa6273e1c 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2729,12 +2729,13 @@ inline void mirrored_helper_loop_inplace(int w, int h, int dxi, int dxs, int dyi inline void mirror_horizonal_bitmap(int w, int h, int dxs, uchar* data, int bpl, bool monolsb) { int shift = w % 8; + const uchar* bitflip = qt_get_bitflip_array(); for (int y = h-1; y >= 0; y--) { quint8* a0 = (quint8*)(data + y*bpl); // Swap bytes quint8* a = a0+dxs; while (a >= a0) { - *a = qt_get_bitflip_array()[*a]; + *a = bitflip[*a]; a--; } // Shift bits if unaligned -- cgit v1.2.3