blur-effect: Don't check whether effect is enabled when painting

A ClutterEffect is being painted as part of the paint cycle of
ClutterActor, where _clutter_effect_paint() is called before painting
the actual actor. With that, it's impossible that an effect gets painted
while it's disabled, so remove the check whether the ClutterActorMeta is
enabled before painting.

Also if everything works fine in Clutter, the ClutterActorMeta should
have an actor set and we've been notified about that actor in
shell_blur_effect_set_actor(), so assert that our cached actor is set
when painting the effect.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1000
This commit is contained in:
Jonas Dreßler 2020-03-27 23:00:36 +01:00 committed by Georges Basile Stavracas Neto
parent 48b0a91385
commit e5b7462b94

View File

@ -681,12 +681,6 @@ update_framebuffers (ShellBlurEffect *self)
float height = -1; float height = -1;
float width = -1; float width = -1;
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (self)))
return FALSE;
if (!self->actor)
return FALSE;
get_target_size (self, &width, &height); get_target_size (self, &width, &height);
downscale_factor = calculate_downscale_factor (width, height, self->sigma); downscale_factor = calculate_downscale_factor (width, height, self->sigma);
@ -776,6 +770,8 @@ shell_blur_effect_paint (ClutterEffect *effect,
ShellBlurEffect *self = SHELL_BLUR_EFFECT (effect); ShellBlurEffect *self = SHELL_BLUR_EFFECT (effect);
uint8_t paint_opacity; uint8_t paint_opacity;
g_assert (self->actor != NULL);
if (self->sigma > 0) if (self->sigma > 0)
{ {
if (needs_repaint (self, flags)) if (needs_repaint (self, flags))