sna: Limit generic convolution to smallish kernels

Since the naive implementation uses an 8bit temporary, we can only
support so many passes before the quantization artefacts become
apparent. We have to be extra conservation in order to support
multi-pass convolution algorithms (notable 2-pass separable Gaussian
kernels).

References: https://bugs.freedesktop.org/show_bug.cgi?id=95091
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-04-23 21:42:12 +01:00
parent cac8e1ee74
commit bca4e0e35e
1 changed files with 4 additions and 2 deletions

View File

@ -1326,6 +1326,8 @@ sna_render_picture_convolve(struct sna *sna,
*/
DBG(("%s: origin=(%d,%d) kernel=%dx%d, size=%dx%d\n",
__FUNCTION__, x_off, y_off, cw, ch, w, h));
if (cw*ch > 32) /* too much loss of precision from quantization! */
return -1;
assert(picture->pDrawable);
assert(picture->filter == PictFilterConvolution);
@ -1376,9 +1378,9 @@ sna_render_picture_convolve(struct sna *sna,
alpha = CreateSolidPicture(0, &color, &error);
if (alpha) {
sna_composite(PictOpAdd, picture, alpha, tmp,
x, y,
x-(x_off+i), y-(y_off+j),
0, 0,
0, 0,
x_off+i, y_off+j,
w, h);
FreePicture(alpha, 0);
}