glamor_render: fix PictFilters
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>
This commit is contained in:
parent
5695708ecd
commit
2f62bd46cc
|
@ -568,6 +568,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
|
||||||
|
|
||||||
switch (picture->filter) {
|
switch (picture->filter) {
|
||||||
default:
|
default:
|
||||||
|
case PictFilterFast:
|
||||||
case PictFilterNearest:
|
case PictFilterNearest:
|
||||||
dispatch->glTexParameteri(GL_TEXTURE_2D,
|
dispatch->glTexParameteri(GL_TEXTURE_2D,
|
||||||
GL_TEXTURE_MIN_FILTER,
|
GL_TEXTURE_MIN_FILTER,
|
||||||
|
@ -576,6 +577,8 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
|
||||||
GL_TEXTURE_MAG_FILTER,
|
GL_TEXTURE_MAG_FILTER,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
|
case PictFilterGood:
|
||||||
|
case PictFilterBest:
|
||||||
case PictFilterBilinear:
|
case PictFilterBilinear:
|
||||||
dispatch->glTexParameteri(GL_TEXTURE_2D,
|
dispatch->glTexParameteri(GL_TEXTURE_2D,
|
||||||
GL_TEXTURE_MIN_FILTER,
|
GL_TEXTURE_MIN_FILTER,
|
||||||
|
@ -1771,6 +1774,12 @@ _glamor_composite(CARD8 op,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((source && source->filter >= PictFilterConvolution)
|
||||||
|
|| (mask && mask->filter >= PictFilterConvolution)) {
|
||||||
|
glamor_fallback("glamor_composite(): unsupported filter\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (!miComputeCompositeRegion(®ion,
|
if (!miComputeCompositeRegion(®ion,
|
||||||
source, mask, dest,
|
source, mask, dest,
|
||||||
x_source + (source_pixmap ? source->pDrawable->x : 0),
|
x_source + (source_pixmap ? source->pDrawable->x : 0),
|
||||||
|
|
Loading…
Reference in New Issue