clutter/actor: Push/pop color state in actor node
Instead of ClutterActor doing that manually in the paint routines manually, delegate that to the actor node. This will help with the move to ClutterSnapshot. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4160>
This commit is contained in:
parent
6d37dbdc40
commit
551db47b4c
@ -3498,8 +3498,6 @@ clutter_actor_paint (ClutterActor *self,
|
||||
}
|
||||
#endif
|
||||
|
||||
clutter_paint_context_push_color_state (paint_context, priv->color_state);
|
||||
|
||||
actor_node = clutter_actor_node_new (self, -1);
|
||||
root_node = clutter_paint_node_ref (actor_node);
|
||||
|
||||
@ -3612,7 +3610,7 @@ clutter_actor_paint (ClutterActor *self,
|
||||
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS))
|
||||
_clutter_actor_paint_cull_result (self, success, result, actor_node);
|
||||
else if (result == CLUTTER_CULL_RESULT_OUT && success)
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->effects == NULL)
|
||||
@ -3631,9 +3629,6 @@ clutter_actor_paint (ClutterActor *self,
|
||||
* unless a new redraw was queued up.
|
||||
*/
|
||||
priv->is_dirty = priv->propagated_one_redraw;
|
||||
|
||||
out:
|
||||
clutter_paint_context_pop_color_state (paint_context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1009,6 +1009,7 @@ clutter_actor_node_pre_draw (ClutterPaintNode *node,
|
||||
ClutterPaintContext *paint_context)
|
||||
{
|
||||
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||
ClutterColorState *color_state;
|
||||
|
||||
if (actor_node->opacity_override != -1)
|
||||
{
|
||||
@ -1020,6 +1021,9 @@ clutter_actor_node_pre_draw (ClutterPaintNode *node,
|
||||
|
||||
CLUTTER_SET_PRIVATE_FLAGS (actor_node->actor, CLUTTER_IN_PAINT);
|
||||
|
||||
color_state = clutter_actor_get_color_state (actor_node->actor);
|
||||
clutter_paint_context_push_color_state (paint_context, color_state);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1038,6 +1042,8 @@ clutter_actor_node_post_draw (ClutterPaintNode *node,
|
||||
{
|
||||
ClutterActorNode *actor_node = CLUTTER_ACTOR_NODE (node);
|
||||
|
||||
clutter_paint_context_pop_color_state (paint_context);
|
||||
|
||||
CLUTTER_UNSET_PRIVATE_FLAGS (actor_node->actor, CLUTTER_IN_PAINT);
|
||||
|
||||
if (actor_node->opacity_override != -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user