background: Shrink wallpaper using LINEAR_MIPMAP_LINEAR

Commit 8e9184b6 added filtering to avoid image jaggies when downscaling
but used `LINEAR_MIPMAP_NEAREST`. In some situations this could lead to
GL choosing a single lower resolution mipmap and then upscaling it, hence
slightly blurry.

We don't want to revert that change since it avoids aliasing jaggies, so
let's use `LINEAR_MIPMAP_LINEAR` instead. This provides the highest quality
filtering that GL can do and avoids the situation of GL using a single
mipmap that's lower resolution than the screen. Now it will blend that one
with the next mipmap which is higher resolution than the screen. This still
avoids jaggies but also maintains 1px resolution.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1105
https://gitlab.gnome.org/GNOME/mutter/merge_requests/505
This commit is contained in:
Daniel van Vugt 2019-03-25 11:27:38 +08:00
parent 1eabaf12da
commit d15e11bfe7

View File

@ -615,7 +615,7 @@ create_pipeline (PipelineType type)
cogl_pipeline_set_layer_filters (templates[type],
0,
COGL_PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST,
COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR,
COGL_PIPELINE_FILTER_LINEAR);
return cogl_pipeline_copy (templates[type]);