[mutter/gbsneto/effects-paint-nodes: 15/22] clutter/offscreen-effect: Clear framebuffer on pre_paint
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/effects-paint-nodes: 15/22] clutter/offscreen-effect: Clear framebuffer on pre_paint
- Date: Wed, 8 Jul 2020 16:56:47 +0000 (UTC)
commit 06166282b5111432fd6c9bdcb43a9a47a25bbe95
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 27 22:18:45 2020 -0300
clutter/offscreen-effect: Clear framebuffer on pre_paint
Move the framebuffer cleanup to ClutterOffscreenEffect.pre_paint().
This will allow us to properly chain up ClutterOffscreenEffect.paint()
and not reimplement exactly what ClutterEffect does by default.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1340
clutter/clutter/clutter-offscreen-effect.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index 75174ef104..e3846e7314 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -246,10 +246,10 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect,
local_offset = GRAPHENE_POINT3D_INIT (0.0f, 0.0f, 0.0f);
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
- return FALSE;
+ goto fail;
if (priv->actor == NULL)
- return FALSE;
+ goto fail;
stage = _clutter_actor_get_stage_internal (priv->actor);
clutter_actor_get_size (stage, &stage_width, &stage_height);
@@ -294,7 +294,7 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect,
/* First assert that the framebuffer is the right size... */
if (!update_fbo (effect, target_width, target_height, resource_scale))
- return FALSE;
+ goto fail;
framebuffer = clutter_paint_context_get_framebuffer (paint_context);
cogl_framebuffer_get_modelview_matrix (framebuffer, &old_modelview);
@@ -361,6 +361,10 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect,
clutter_actor_set_opacity_override (priv->actor, 0xff);
return TRUE;
+
+fail:
+ cogl_clear_object (&priv->offscreen);
+ return FALSE;
}
static void
@@ -488,8 +492,6 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
if (pre_paint_succeeded)
effect_class->post_paint (effect, paint_context);
- else
- g_clear_pointer (&priv->offscreen, cogl_object_unref);
}
else
clutter_offscreen_effect_paint_texture (self, paint_context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]