diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-01 10:42:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-01 20:39:08 +0100 |
commit | d07256cc3360cf94d131d9a1b24d9f1c6a70ee04 (patch) | |
tree | b9f761ee3c04eae33a5e8ef70411142985d8b3c0 | |
parent | d09a229e32468c810f5056bfd0043f2fb68038d3 (diff) |
sna/accel: Convert segments into spans similarly to PolyLine
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8f3aabc1..2614e479 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2381,6 +2381,33 @@ sna_poly_segment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg) return; } + /* XXX Do we really want to base this decision on the amalgam ? */ + if (sna_drawable_use_gpu_bo(drawable, &extents)) { + void (*line)(DrawablePtr, GCPtr, int, int, DDXPointPtr); + int i; + + DBG(("%s: converting segments into spans\n", __FUNCTION__)); + + switch (gc->lineStyle) { + default: + case LineSolid: + if (gc->lineWidth == 0) + line = miZeroLine; + else + line = miWideLine; + break; + case LineOnOffDash: + case LineDoubleDash: + line = miWideDash; + break; + } + + for (i = 0; i < n; i++) + line(drawable, gc, CoordModeOrigin, 2, + (DDXPointPtr)&seg[i]); + return; + } + fallback: DBG(("%s: fallback\n", __FUNCTION__)); RegionInit(®ion, &extents, 1); |