Commit 7f379c05ea9e6b60c081af2c18a84ec290af2df4
- Diff rendering mode:
- inline
- side by side
src/gui/painting/qdrawhelper_arm_gnu.cpp
(23 / 2)
|   | |||
| 122 | 122 | // -- I could not verify this on a Cortex-A8 with the above UNROLL_LOOP_WITH_PLD | |
| 123 | 123 | # define PRELOAD_COND2(x,y) if (((uint)&x[i])%L2CacheLineLength == 0) preload(&x[i] + L2CacheLineLengthInInts); \ | |
| 124 | 124 | if (((uint)&y[i])%L2CacheLineLength == 16) preload(&y[i] + L2CacheLineLengthInInts); | |
| 125 | |||
| 126 | Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_ARM(uint x, uint a) { | ||
| 127 | switch (a) { | ||
| 128 | case 255: | ||
| 129 | return x; | ||
| 130 | case 0: | ||
| 131 | return 0; | ||
| 132 | default: { | ||
| 133 | uint t = (x & 0xff00ff) * a; | ||
| 134 | t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; | ||
| 135 | t &= 0xff00ff; | ||
| 136 | |||
| 137 | x = ((x >> 8) & 0xff00ff) * a; | ||
| 138 | x = (x + ((x >> 8) & 0xff00ff) + 0x800080); | ||
| 139 | x &= 0xff00ff00; | ||
| 140 | x |= t; | ||
| 141 | return x; | ||
| 142 | } | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 125 | 146 | void comp_func_SourceOver_arm(uint *dest, const uint *src, int length, uint const_alpha) | |
| 126 | 147 | { | |
| 127 | 148 | PRELOAD_INIT2(dest, src) | |
| … | … | ||
| 155 | 155 | dest[i] = src[i]; | |
| 156 | 156 | } else { | |
| 157 | 157 | uint s = src[i]; | |
| 158 | dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); | ||
| 158 | dest[i] = s + BYTE_MUL_ARM(dest[i], qAlpha(~s)); | ||
| 159 | 159 | } | |
| 160 | 160 | ||
| 161 | 161 | ++i; | |
| … | … | ||
| 164 | 164 | int i = 0; | |
| 165 | 165 | while (i < length) { | |
| 166 | 166 | uint s = BYTE_MUL(src[i], const_alpha); | |
| 167 | dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s)); | ||
| 167 | dest[i] = s + BYTE_MUL_ARM(dest[i], qAlpha(~s)); | ||
| 168 | 168 | PRELOAD_COND2(dest, src) | |
| 169 | 169 | ++i; | |
| 170 | 170 | } |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

