]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix copying of overlapping bitmaps. The cases of copying within the
authorbde <bde@FreeBSD.org>
Fri, 19 Apr 2019 20:29:49 +0000 (20:29 +0000)
committerbde <bde@FreeBSD.org>
Fri, 19 Apr 2019 20:29:49 +0000 (20:29 +0000)
commit2a3a7ab5a709a997c9babb156c2c49d80d11c2df
tree757b0c5f0a7d460a11fe42d3cbbd8a2d58f53d1d
parent3288ae0d72f2c7aa900fde8e1748f85d0b2fcf21
Fix copying of overlapping bitmaps.  The cases of copying within the
screen bitmap and within a single MEMBUF were broken when first source
line is before the first destination line and the sub-bitmaps overlap.

The fix just copies horizontal lines in reverse order when the first
source line is before the first destination line.  This switches
directions unnecessarily in some cases, but the switch is about as
fast as doing a precise detection of overlaps.  When the first lines
are the same, there can be undetected overlap in the horizontal
direction.  The old code already handles this mostly accidentally by
using bcopy() for MEMBUFs and by copying through a temporary buffer
for the screen bitmap although the latter is sub-optimal in direct
modes.
lib/libvgl/bitmap.c