From 31c5eb8e906bf8e59743372edb2d703b50cd311e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 3 Nov 2011 17:07:48 +0000 Subject: [PATCH] sna: Clean up the fallback code for glyphs Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 47 +++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index a2e9dc24..555cbc67 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -7548,19 +7548,19 @@ sna_image_glyph(DrawablePtr drawable, GCPtr gc, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2)); - if (FORCE_FALLBACK) - goto fallback_clip; - - if (wedged(sna)) { - DBG(("%s: fallback -- wedged\n", __FUNCTION__)); - goto fallback_clip; - } - region.data = NULL; region_maybe_clip(®ion, gc->pCompositeClip); if (!RegionNotEmpty(®ion)) return; + if (FORCE_FALLBACK) + goto fallback; + + if (wedged(sna)) { + DBG(("%s: fallback -- wedged\n", __FUNCTION__)); + goto fallback; + } + if (sna_drawable_use_gpu_bo(drawable, ®ion.extents, &damage) && sna_reversed_glyph_blt(drawable, gc, x, y, n, info, base, damage, ®ion, false)) { @@ -7577,14 +7577,6 @@ fallback: DBG(("%s: fallback -- fbImageGlyphBlt\n", __FUNCTION__)); fbImageGlyphBlt(drawable, gc, x, y, n, info, base); return; - -fallback_clip: - region.data = NULL; - region_maybe_clip(®ion, gc->pCompositeClip); - if (!RegionNotEmpty(®ion)) - return; - - goto fallback; } static void @@ -7615,19 +7607,19 @@ sna_poly_glyph(DrawablePtr drawable, GCPtr gc, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2)); - if (FORCE_FALLBACK) - goto fallback_clip; - - if (wedged(sna)) { - DBG(("%s: fallback -- wedged\n", __FUNCTION__)); - goto fallback_clip; - } - region.data = NULL; region_maybe_clip(®ion, gc->pCompositeClip); if (!RegionNotEmpty(®ion)) return; + if (FORCE_FALLBACK) + goto fallback; + + if (wedged(sna)) { + DBG(("%s: fallback -- wedged\n", __FUNCTION__)); + goto fallback; + } + if (sna_drawable_use_gpu_bo(drawable, ®ion.extents, &damage) && sna_reversed_glyph_blt(drawable, gc, x, y, n, info, base, damage, ®ion, true)) { @@ -7644,13 +7636,6 @@ fallback: DBG(("%s: fallback -- fbPolyGlyphBlt\n", __FUNCTION__)); fbPolyGlyphBlt(drawable, gc, x, y, n, info, base); -fallback_clip: - region.data = NULL; - region_maybe_clip(®ion, gc->pCompositeClip); - if (!RegionNotEmpty(®ion)) - return; - goto fallback; - } static bool