diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-06 15:14:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-06 15:14:45 +0100 |
commit | 0b81bafb802bb86454739ed46cf45571bccef735 (patch) | |
tree | 59f6f6231411edfc4ce81823a50c8f29dc56d750 | |
parent | 42a84613e34522af885b4b50d6c68ef77e81ffc3 (diff) |
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 <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_glyphs.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; |