clutter/offscreen-effect: Implement paint_node()

The paint node tree that ClutterOffscreenEffect generates is
simple:

  Root
    |------------+
    |            |
  Layer        Pipeline
    |
  Actor

Right now, both pre-paint and ClutterLayerNode push the offscreen
to the framebuffer stack. That's harmless, and will go away soon
anyway.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1355
This commit is contained in:
Georges Basile Stavracas Neto 2020-07-05 17:57:37 -03:00
parent 1135a74e3e
commit e9b9784c5c

View File

@ -483,6 +483,30 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect,
clutter_offscreen_effect_paint_texture (self, paint_context); clutter_offscreen_effect_paint_texture (self, paint_context);
} }
static void
clutter_offscreen_effect_paint_node (ClutterEffect *effect,
ClutterPaintNode *node,
ClutterPaintContext *paint_context,
ClutterEffectPaintFlags flags)
{
ClutterOffscreenEffect *offscreen_effect = CLUTTER_OFFSCREEN_EFFECT (effect);
ClutterOffscreenEffectPrivate *priv = offscreen_effect->priv;
ClutterPaintNode *layer_node;
ClutterPaintNode *actor_node;
layer_node = clutter_layer_node_new_with_framebuffer (priv->offscreen,
priv->pipeline,
255);
clutter_paint_node_set_static_name (layer_node,
"ClutterOffscreenEffect (actor offscreen)");
clutter_paint_node_add_child (node, layer_node);
clutter_paint_node_unref (layer_node);
actor_node = clutter_actor_node_new (priv->actor, 255);
clutter_paint_node_add_child (layer_node, actor_node);
clutter_paint_node_unref (actor_node);
}
static void static void
clutter_offscreen_effect_paint (ClutterEffect *effect, clutter_offscreen_effect_paint (ClutterEffect *effect,
ClutterPaintContext *paint_context, ClutterPaintContext *paint_context,
@ -556,6 +580,7 @@ clutter_offscreen_effect_class_init (ClutterOffscreenEffectClass *klass)
effect_class->pre_paint = clutter_offscreen_effect_pre_paint; effect_class->pre_paint = clutter_offscreen_effect_pre_paint;
effect_class->post_paint = clutter_offscreen_effect_post_paint; effect_class->post_paint = clutter_offscreen_effect_post_paint;
effect_class->paint = clutter_offscreen_effect_paint; effect_class->paint = clutter_offscreen_effect_paint;
effect_class->paint_node = clutter_offscreen_effect_paint_node;
gobject_class->finalize = clutter_offscreen_effect_finalize; gobject_class->finalize = clutter_offscreen_effect_finalize;
} }