Add Fast/Good/Best and appropriately map to Nearest and
Bilinear. Additionally, add a fallback path for unsupported filters.
Notably, this fixes window shadow rendering with Compiz, which uses
PictFilterConvolution for some odd reason.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
switch (picture->filter) {
default:
+ case PictFilterFast:
case PictFilterNearest:
dispatch->glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_TEXTURE_MAG_FILTER,
GL_NEAREST);
break;
+ case PictFilterGood:
+ case PictFilterBest:
case PictFilterBilinear:
dispatch->glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
}
}
+ if ((source && source->filter >= PictFilterConvolution)
+ || (mask && mask->filter >= PictFilterConvolution)) {
+ glamor_fallback("glamor_composite(): unsupported filter\n");
+ goto fail;
+ }
+
if (!miComputeCompositeRegion(®ion,
source, mask, dest,
x_source + (source_pixmap ? source->pDrawable->x : 0),