st/private: Don't scale the framebuffer, only the blur pixels

Just as we did before e59069c012.

Callers already ensure the framebuffer is scaled so by scaling a second
time in `_st_create_shadow_pipeline` we actually got resource_scale² which
was visibly incorrect.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3505,
       https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3560

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1543>
This commit is contained in:
Daniel van Vugt 2021-01-07 15:09:55 +08:00
parent b51be0e389
commit eefed95fa7

View File

@ -400,7 +400,7 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
g_return_val_if_fail (shadow_spec != NULL, NULL); g_return_val_if_fail (shadow_spec != NULL, NULL);
g_return_val_if_fail (src_texture != NULL, NULL); g_return_val_if_fail (src_texture != NULL, NULL);
sigma = shadow_spec->blur / 2.f; sigma = resource_scale * shadow_spec->blur / 2.f;
sampling_radius = ceilf (1.5 * sigma) * 2.0; sampling_radius = ceilf (1.5 * sigma) * 2.0;
src_width = cogl_texture_get_width (src_texture); src_width = cogl_texture_get_width (src_texture);
@ -422,7 +422,6 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0.f, 0.f, 0.f, 0.f); cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0.f, 0.f, 0.f, 0.f);
cogl_framebuffer_orthographic (fb, 0, 0, dst_width, dst_height, 0, 1.0); cogl_framebuffer_orthographic (fb, 0, 0, dst_width, dst_height, 0, 1.0);
cogl_framebuffer_scale (fb, resource_scale, resource_scale, 1);
/* Blur */ /* Blur */
blur_node = clutter_blur_node_new (dst_width, dst_height, sigma); blur_node = clutter_blur_node_new (dst_width, dst_height, sigma);