From 0b81bafb802bb86454739ed46cf45571bccef735 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 6 Apr 2012 15:14:45 +0100 Subject: [PATCH] sna/glyphs: Prefer a temporary upload mask for large glyph masks If the required temporary mask is larger than the 3D pipeline can handle, just render to a CPU buffer rather than redirect every glyph composition. Signed-off-by: Chris Wilson --- src/sna/sna_glyphs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index 235528cb..87371aad 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -662,6 +662,13 @@ clear_pixmap(struct sna *sna, PixmapPtr pixmap) return sna->render.clear(sna, pixmap, priv->gpu_bo); } +static bool +too_large(struct sna *sna, int width, int height) +{ + return (width > sna->render.max_3d_size || + height > sna->render.max_3d_size); +} + static Bool glyphs_via_mask(struct sna *sna, CARD8 op, @@ -724,7 +731,8 @@ glyphs_via_mask(struct sna *sna, component_alpha = NeedsComponent(format->format); if (!NO_SMALL_MASK && - (uint32_t)width * height * format->depth < 8 * 4096) { + ((uint32_t)width * height * format->depth < 8 * 4096 || + too_large(sna, width, height))) { pixman_image_t *mask_image; int s;