mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
clutter/offscreen-effect: Clear offscreen framebuffer when disabling
When changing the 'enabled' property and disabling the offscreen effect, it doesn't make sense to preserve the offscreen framebuffer. It's not drawing, after all. Furthermore, because ClutterOffscreenEffect only checks if the offscreen framebuffer exists to decide whether or not to redraw, keeping the fbo alive is a waste of resources. Clear the offscreen framebuffer when the effect is disabled or enabled. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/810 https://gitlab.gnome.org/GNOME/mutter/merge_requests/992
This commit is contained in:
parent
3958e75ed2
commit
bf594e9fb6
@ -483,6 +483,19 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
|
||||
clutter_offscreen_effect_paint_texture (self, paint_context);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_offscreen_effect_notify (GObject *gobject,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterOffscreenEffect *offscreen_effect = CLUTTER_OFFSCREEN_EFFECT (gobject);
|
||||
ClutterOffscreenEffectPrivate *priv = offscreen_effect->priv;
|
||||
|
||||
if (strcmp (pspec->name, "enabled") == 0)
|
||||
g_clear_pointer (&priv->offscreen, cogl_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (clutter_offscreen_effect_parent_class)->notify (gobject, pspec);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_offscreen_effect_finalize (GObject *gobject)
|
||||
{
|
||||
@ -513,6 +526,7 @@ clutter_offscreen_effect_class_init (ClutterOffscreenEffectClass *klass)
|
||||
effect_class->paint = clutter_offscreen_effect_paint;
|
||||
|
||||
gobject_class->finalize = clutter_offscreen_effect_finalize;
|
||||
gobject_class->notify = clutter_offscreen_effect_notify;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user