688 | | |
689 | | // TODO: This code may not work correctly on architectures that require alignment. |
690 | | // And even on those which accept it, reading/writing 32 bits words from odd memory |
691 | | // locations usually has a speed penalty. Hence, it might be wise to first check |
692 | | // if the dst address is odd, in which case we blit one pixel first; then we |
693 | | // blit pixel pairs, till we get to the end, at which point we may have to blit |
694 | | // again a single seperate pixel. This would of course cause additional overhead |
695 | | // for each blitted line. Some of that overhead can be avoid by moving |
696 | | // this logic into stretch200To240, since whether dst is at an odd position, and |
697 | | // whether the last pixel has to be blitted seperately or not, is identical for |
698 | | // each blitted line. |
699 | | // |
700 | | |
701 | | if (width & 1) { |
702 | | // For efficency reasons we normally blit two pixels at a time; but if the |
703 | | // width is odd, we first blit a single pixel. |
704 | | width--; |
705 | | if (scale == 1) { |
706 | | uint32 B = *srcB++; |
707 | | *dst++ = (uint16)Q_INTERPOLATE(*srcA++, B, B, B); |
708 | | } else { |
709 | | *dst++ = (uint16)INTERPOLATE(*srcA++, *srcB++); |
710 | | } |
711 | | } |
| 688 | // For efficiency reasons we blit two pixels at a time, so it is |
| 689 | // important that makeRectStretchable() guarantees that the width is |
| 690 | // even and that the rect starts on a well-aligned address. (Even |
| 691 | // where unaligned memory access is allowed there may be a speed |
| 692 | // penalty for it.) |