sna: Defer CPU fallback if fb calls into mi

If the fb routine does not access the pixel data directly, but instead
calls into an mi routine, we can defer the readback and possibly avoid
it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-10-17 00:55:51 +01:00
parent c348b69f66
commit 17acaf8e23
1 changed files with 19 additions and 0 deletions

View File

@ -2365,6 +2365,14 @@ sna_poly_line(DrawablePtr drawable, GCPtr gc,
}
fallback:
if (gc->lineWidth) {
if (gc->lineStyle != LineSolid)
miWideDash(drawable, gc, mode, n, pt);
else
miWideLine(drawable, gc, mode, n, pt);
return;
}
DBG(("%s: fallback\n", __FUNCTION__));
region_set(&region, &extents);
region_maybe_clip(&region, gc->pCompositeClip);
@ -2670,6 +2678,11 @@ sna_poly_segment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg)
}
fallback:
if (gc->lineWidth) {
miPolySegment(drawable, gc, n, seg);
return;
}
DBG(("%s: fallback\n", __FUNCTION__));
region_set(&region, &extents);
region_maybe_clip(&region, gc->pCompositeClip);
@ -2774,6 +2787,11 @@ sna_poly_arc(DrawablePtr drawable, GCPtr gc, int n, xArc *arc)
}
fallback:
if (gc->lineWidth) {
miPolyArc(drawable, gc, n, arc);
return;
}
region_set(&region, &extents);
region_maybe_clip(&region, gc->pCompositeClip);
if (!RegionNotEmpty(&region))
@ -2783,6 +2801,7 @@ fallback:
sna_drawable_move_region_to_cpu(drawable, &region, true);
RegionUninit(&region);
/* XXX may still fallthrough to miZeroPolyArc */
fbPolyArc(drawable, gc, n, arc);
}