glamor: Improve the performance of line fallbacks.
If the lines aren't solid-filled vert/horiz solid-filled rectangles, we fall back. libreoffice has some diagonal lines, and the performance of the fallback path was atrocious. Just fall back to mi's spans instead, so that we don't do an upload/download. Improves x11perf -seg100 by 863.652% +/- 9.8968% (n=5) Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
b695304556
commit
923c8db7ed
|
@ -51,8 +51,9 @@ _glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
|
||||||
/* This ends up in miSetSpans, which is accelerated as well as we
|
/* This ends up in miSetSpans, which is accelerated as well as we
|
||||||
* can hope X wide lines will be.
|
* can hope X wide lines will be.
|
||||||
*/
|
*/
|
||||||
goto wide_line;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gc->lineStyle != LineSolid) {
|
if (gc->lineStyle != LineSolid) {
|
||||||
glamor_fallback("non-solid fill line style %d\n", gc->lineStyle);
|
glamor_fallback("non-solid fill line style %d\n", gc->lineStyle);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -104,19 +105,19 @@ _glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
|
||||||
&& glamor_ddx_fallback_check_gc(gc))
|
&& glamor_ddx_fallback_check_gc(gc))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gc->lineWidth == 0) {
|
switch (gc->lineStyle) {
|
||||||
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
|
case LineSolid:
|
||||||
glamor_prepare_access_gc(gc)) {
|
if (gc->lineWidth == 0)
|
||||||
fbPolyLine(drawable, gc, mode, n, points);
|
miZeroLine(drawable, gc, mode, n, points);
|
||||||
}
|
else
|
||||||
glamor_finish_access_gc(gc);
|
miWideLine(drawable, gc, mode, n, points);
|
||||||
glamor_finish_access(drawable);
|
break;
|
||||||
}
|
case LineOnOffDash:
|
||||||
else {
|
case LineDoubleDash:
|
||||||
wide_line:
|
miWideDash(drawable, gc, mode, n, points);
|
||||||
/* fb calls mi functions in the lineWidth != 0 case. */
|
break;
|
||||||
fbPolyLine(drawable, gc, mode, n, points);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user