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:
parent
42a84613e3
commit
0b81bafb80
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue