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>
This commit is contained in:
parent
b709d07c34
commit
433ea5eb0c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user