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>
This commit is contained in:
Chris Wilson 2012-04-06 15:14:45 +01:00
parent 42a84613e3
commit 0b81bafb80
1 changed files with 9 additions and 1 deletions

View File

@ -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;