paint-nodes: Sanity check color transform in blit nodes
Blitting cannot run with a shader, thus cannot do color state transformations, so log a warning when that happens. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
This commit is contained in:

committed by
Sebastian Wick

parent
9a0fbbfa81
commit
a1163385db
@ -843,3 +843,20 @@ clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
|||||||
g_object_ref (snippet));
|
g_object_ref (snippet));
|
||||||
return snippet;
|
return snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
clutter_color_state_equals (ClutterColorState *color_state,
|
||||||
|
ClutterColorState *other_color_state)
|
||||||
|
{
|
||||||
|
ClutterColorStatePrivate *priv;
|
||||||
|
ClutterColorStatePrivate *other_priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (color_state), FALSE);
|
||||||
|
g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (other_color_state), FALSE);
|
||||||
|
|
||||||
|
priv = clutter_color_state_get_instance_private (color_state);
|
||||||
|
other_priv = clutter_color_state_get_instance_private (other_color_state);
|
||||||
|
|
||||||
|
return (priv->colorspace == other_priv->colorspace &&
|
||||||
|
priv->transfer_function == other_priv->transfer_function);
|
||||||
|
}
|
||||||
|
@ -53,4 +53,8 @@ CLUTTER_EXPORT
|
|||||||
CoglSnippet * clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
CoglSnippet * clutter_color_state_get_transform_snippet (ClutterColorState *color_state,
|
||||||
ClutterColorState *target_color_state);
|
ClutterColorState *target_color_state);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
gboolean clutter_color_state_equals (ClutterColorState *color_state,
|
||||||
|
ClutterColorState *other_color_state);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -1336,6 +1336,10 @@ clutter_blit_node_draw (ClutterPaintNode *node,
|
|||||||
if (node->operations == NULL)
|
if (node->operations == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
g_warn_if_fail (clutter_color_state_equals (
|
||||||
|
clutter_paint_context_get_color_state (paint_context),
|
||||||
|
clutter_paint_context_get_target_color_state (paint_context)));
|
||||||
|
|
||||||
framebuffer = get_target_framebuffer (node, paint_context);
|
framebuffer = get_target_framebuffer (node, paint_context);
|
||||||
|
|
||||||
for (i = 0; i < node->operations->len; i++)
|
for (i = 0; i < node->operations->len; i++)
|
||||||
|
Reference in New Issue
Block a user