diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-12 14:06:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-12 14:06:22 +0000 |
commit | 7932a2a259069bb7d19af8566f7b7704f6c2eade (patch) | |
tree | b0fc13a3111d424e3b7fb1fa82d12e750185f2ea /src | |
parent | b7cefddd467bfd0c100219969712a0133475004c (diff) |
sna: Update for removal of backwards compatible miWideDash
miWideDash() no longer calls miZeroLineDash() when called with
gc->lineWidth==0, we need to do so ourselves.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 35761760..c8a1e154 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4976,8 +4976,9 @@ static void sna_poly_line(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr pt) { - PixmapPtr pixmap = get_drawable_pixmap(drawable); - struct sna *sna = to_sna_from_pixmap(pixmap); + PixmapPtr pixmap; + struct sna *sna; + struct sna_pixmap *priv; struct sna_damage **damage; RegionRec region; unsigned flags; @@ -4997,6 +4998,8 @@ sna_poly_line(DrawablePtr drawable, GCPtr gc, if (FORCE_FALLBACK) goto fallback; + pixmap = get_drawable_pixmap(drawable); + sna = to_sna_from_pixmap(pixmap); if (wedged(sna)) { DBG(("%s: fallback -- wedged\n", __FUNCTION__)); goto fallback; @@ -5013,15 +5016,26 @@ sna_poly_line(DrawablePtr drawable, GCPtr gc, if (!PM_IS_SOLID(drawable, gc->planemask)) goto fallback; - if (gc->lineStyle != LineSolid) + priv = sna_pixmap(pixmap); + if (!priv) { + DBG(("%s: not attached to pixmap %ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); + goto fallback; + } + + if (gc->lineStyle != LineSolid) { + DBG(("%s: lineStyle, %d, is not solid\n", + __FUNCTION__, gc->lineStyle)); goto spans_fallback; + } if (!(gc->lineWidth == 0 || - (gc->lineWidth == 1 && (n == 1 || gc->alu == GXcopy)))) + (gc->lineWidth == 1 && (n == 1 || gc->alu == GXcopy)))) { + DBG(("%s: non-zero lineWidth %d\n", + __FUNCTION__, gc->lineWidth)); goto spans_fallback; + } if (gc->fillStyle == FillSolid) { - struct sna_pixmap *priv = sna_pixmap(pixmap); - DBG(("%s: trying solid fill [%08lx]\n", __FUNCTION__, gc->fgPixel)); @@ -5056,8 +5070,6 @@ sna_poly_line(DrawablePtr drawable, GCPtr gc, } } else if (flags & 4) { - struct sna_pixmap *priv = sna_pixmap(pixmap); - /* Try converting these to a set of rectangles instead */ if (sna_drawable_use_gpu_bo(drawable, ®ion.extents, &damage)) { DDXPointRec p1, p2; @@ -5132,15 +5144,26 @@ spans_fallback: sna_drawable_use_gpu_bo(drawable, ®ion.extents, &damage)) { DBG(("%s: converting line into spans\n", __FUNCTION__)); switch (gc->lineStyle) { + default: + assert(0); case LineSolid: - if (gc->lineWidth == 0) + if (gc->lineWidth == 0) { + DBG(("%s: miZeroLine\n", __FUNCTION__)); miZeroLine(drawable, gc, mode, n, pt); - else + } else { + DBG(("%s: miWideLine\n", __FUNCTION__)); miWideLine(drawable, gc, mode, n, pt); + } break; case LineOnOffDash: case LineDoubleDash: - miWideDash(drawable, gc, mode, n, pt); + if (gc->lineWidth == 0) { + DBG(("%s: miZeroDashLine\n", __FUNCTION__)); + miZeroDashLine(drawable, gc, mode, n, pt); + } else { + DBG(("%s: miWideDash\n", __FUNCTION__)); + miWideDash(drawable, gc, mode, n, pt); + } break; } return; |