Fix copying of MEMBUFs to MEMBUFs. This case was implemented by using
the same code as the VIDBUF8 case, so it only worked for depths <= 8. The 2 directions for copying between VIDBUFs and MEMBUFs worked by using a Read/Write organization which makes the destination a VIDBUF so the MEMBUF case was not reached, and the VIDBUF cases have already been fixed. Fix this by removing "optimizations" for the VIDBUF8 case so that the MEMBUF case can fall through to the general (non-segmented) case. The optimizations were to duplicate code for the VIDBUF8 case so as to avoid 2 multiplications by 1 at runtime. This optimization is not useful since the multiplications are not in the inner loop. Remove the same "optimization" for the VIDBUF8S case. It was even less useful there since it duplicated more to do relatively less.
This commit is contained in:
parent
b96ab4102e
commit
b8e788b67e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=346025
@ -136,16 +136,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIDBUF8S:
|
case VIDBUF8S:
|
||||||
pos = dst->VXsize * y + x;
|
|
||||||
while (width > 0) {
|
|
||||||
offset = VGLSetSegment(pos);
|
|
||||||
i = min(VGLAdpInfo.va_window_size - offset, width);
|
|
||||||
bcopy(line, dst->Bitmap + offset, i);
|
|
||||||
line += i;
|
|
||||||
pos += i;
|
|
||||||
width -= i;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case VIDBUF16S:
|
case VIDBUF16S:
|
||||||
case VIDBUF24S:
|
case VIDBUF24S:
|
||||||
case VIDBUF32S:
|
case VIDBUF32S:
|
||||||
@ -160,11 +150,8 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line)
|
|||||||
width -= i;
|
width -= i;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIDBUF8:
|
|
||||||
case MEMBUF:
|
case MEMBUF:
|
||||||
address = dst->Bitmap + dst->VXsize * y + x;
|
case VIDBUF8:
|
||||||
bcopy(line, address, width);
|
|
||||||
break;
|
|
||||||
case VIDBUF16:
|
case VIDBUF16:
|
||||||
case VIDBUF24:
|
case VIDBUF24:
|
||||||
case VIDBUF32:
|
case VIDBUF32:
|
||||||
@ -251,16 +238,6 @@ ReadVerticalLine(VGLBitmap *src, int x, int y, int width, byte *line)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIDBUF8S:
|
case VIDBUF8S:
|
||||||
pos = src->VXsize * y + x;
|
|
||||||
while (width > 0) {
|
|
||||||
offset = VGLSetSegment(pos);
|
|
||||||
i = min(VGLAdpInfo.va_window_size - offset, width);
|
|
||||||
bcopy(src->Bitmap + offset, line, i);
|
|
||||||
line += i;
|
|
||||||
pos += i;
|
|
||||||
width -= i;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case VIDBUF16S:
|
case VIDBUF16S:
|
||||||
case VIDBUF24S:
|
case VIDBUF24S:
|
||||||
case VIDBUF32S:
|
case VIDBUF32S:
|
||||||
@ -275,11 +252,8 @@ ReadVerticalLine(VGLBitmap *src, int x, int y, int width, byte *line)
|
|||||||
width -= i;
|
width -= i;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIDBUF8:
|
|
||||||
case MEMBUF:
|
case MEMBUF:
|
||||||
address = src->Bitmap + src->VXsize * y + x;
|
case VIDBUF8:
|
||||||
bcopy(address, line, width);
|
|
||||||
break;
|
|
||||||
case VIDBUF16:
|
case VIDBUF16:
|
||||||
case VIDBUF24:
|
case VIDBUF24:
|
||||||
case VIDBUF32:
|
case VIDBUF32:
|
||||||
|
Loading…
Reference in New Issue
Block a user