1
0
mirror of https://github.com/deadw00d/AROS.git synced 2026-03-19 03:28:06 +00:00

Improve RectFill performance

If RASTER_OP capability is not available, fall back to fast fill routines
for most common cases instead of drawing via generic pixel by pixel. This
visibly speeds up for example dragging screen down when there is nothing
behind it. Approach copied from chunkybitmap class.
This commit is contained in:
deadwood
2025-04-04 20:49:57 +02:00
parent e59f7a46fd
commit 8be93bef90
2 changed files with 51 additions and 10 deletions

View File

@ -1,7 +1,7 @@
##begin config
basename VMWareSVGA
libbasetype struct VMWareSVGABase
version 45.5
version 45.6
residentpri 9
classptr_field vsd.vmwaresvgaclass
classdatatype struct VMWareSVGAHiddData

View File

@ -495,19 +495,23 @@ VOID MNAME_BM(GetImageLUT)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_Get
VOID MNAME_BM(FillRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawRect *msg)
{
struct BitmapData *data =OOP_INST_DATA(cl, o);
BOOL done=FALSE;
HIDDT_Pixel pixel;
HIDDT_DrawMode mode;
pixel = GC_FG(msg->gc);
mode = GC_DRMD(msg->gc);
#ifdef OnBitmap
LONG mod = data->data->bytesperline;
#else
LONG mod = data->bytesperpix * data->width;
#endif
D(bug(DEBUGNAME " %s()\n", __func__);)
LOCK_BITMAP
#ifdef OnBitmap
struct HWData *hw;
HIDDT_Pixel pixel;
HIDDT_DrawMode mode;
BOOL done=FALSE;
pixel = GC_FG(msg->gc);
mode = GC_DRMD(msg->gc);
hw = data->data;
if ((VPVISFLAG) && (hw->capabilities & SVGA_CAP_RASTER_OP))
{
@ -573,13 +577,50 @@ VOID MNAME_BM(FillRect)(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawRe
syncfenceVMWareSVGAFIFO(data->data, fenceVMWareSVGAFIFO(data->data));
}
}
#endif
if (!done)
{
switch(mode)
{
case vHidd_GC_DrawMode_Copy:
done = TRUE;
switch(data->bytesperpix)
{
case 1:
/* Not supported */
break;
case 2:
HIDD_BM_FillMemRect16(o, data->VideoData, msg->minX, msg->minY, msg->maxX, msg->maxY, mod, pixel);
break;
case 3:
HIDD_BM_FillMemRect24(o, data->VideoData, msg->minX, msg->minY, msg->maxX, msg->maxY, mod, pixel);
break;
case 4:
HIDD_BM_FillMemRect32(o, data->VideoData, msg->minX, msg->minY, msg->maxX, msg->maxY, mod, pixel);
break;
}
break;
case vHidd_GC_DrawMode_Invert:
done = TRUE;
HIDD_BM_InvertMemRect(o, data->VideoData,
msg->minX * data->bytesperpix, msg->minY,
msg->maxX * data->bytesperpix + data->bytesperpix - 1, msg->maxY,
mod);
break;
} /* switch(mode) */
}
if (!done)
{
OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
}
#else
OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
#endif
UNLOCK_BITMAP
}