diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-01-27 18:22:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-29 00:18:15 +0100 |
commit | 433ea5eb0c3d851f7f074f0e32db2807476a9698 (patch) | |
tree | 9692fa2d2ae475032da9d1c4782347bb8c88e8be | |
parent | b709d07c340e2a6cc3d004f3edf1232b7104b38b (diff) |
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 <gunnar.sletta@jollamobile.com>
-rw-r--r-- | src/gui/image/qimage.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 |