mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter: Don't display actor names on paint volumes
Currently, the paint-volumes/redraws debug flags displays the actor debug names on top of the paint volume making it very unusable. Especially that you can easily get the relevant actor from looking glass. The motivation is to reduce the usage of pango (through the text node) in order to possibly move all the fonts bits to gnome shell Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3571>
This commit is contained in:
parent
aedb0f200d
commit
4fab773e12
@ -3010,7 +3010,6 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
|||||||
static void
|
static void
|
||||||
_clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
_clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||||
ClutterPaintVolume *pv,
|
ClutterPaintVolume *pv,
|
||||||
const char *label,
|
|
||||||
const ClutterColor *color,
|
const ClutterColor *color,
|
||||||
ClutterPaintNode *node)
|
ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
@ -3068,29 +3067,6 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
|||||||
clutter_paint_node_add_primitive (pipeline_node, prim);
|
clutter_paint_node_add_primitive (pipeline_node, prim);
|
||||||
clutter_paint_node_add_child (node, pipeline_node);
|
clutter_paint_node_add_child (node, pipeline_node);
|
||||||
g_object_unref (prim);
|
g_object_unref (prim);
|
||||||
|
|
||||||
if (label)
|
|
||||||
{
|
|
||||||
g_autoptr (ClutterPaintNode) text_node = NULL;
|
|
||||||
PangoLayout *layout;
|
|
||||||
|
|
||||||
layout = pango_layout_new (clutter_actor_get_pango_context (self));
|
|
||||||
pango_layout_set_text (layout, label, -1);
|
|
||||||
|
|
||||||
text_node = clutter_text_node_new (layout, color);
|
|
||||||
clutter_paint_node_set_static_name (text_node,
|
|
||||||
"ClutterActor (paint volume label)");
|
|
||||||
clutter_paint_node_add_rectangle (text_node,
|
|
||||||
&(ClutterActorBox) {
|
|
||||||
.x1 = pv->vertices[0].x,
|
|
||||||
.y1 = pv->vertices[0].y,
|
|
||||||
.x2 = pv->vertices[2].x,
|
|
||||||
.y2 = pv->vertices[2].y,
|
|
||||||
});
|
|
||||||
clutter_paint_node_add_child (node, text_node);
|
|
||||||
|
|
||||||
g_object_unref (layout);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3115,7 +3091,6 @@ _clutter_actor_draw_paint_volume (ClutterActor *self,
|
|||||||
|
|
||||||
clutter_color_init (&color, 0, 0, 255, 255);
|
clutter_color_init (&color, 0, 0, 255, 255);
|
||||||
_clutter_actor_draw_paint_volume_full (self, &fake_pv,
|
_clutter_actor_draw_paint_volume_full (self, &fake_pv,
|
||||||
_clutter_actor_get_debug_name (self),
|
|
||||||
&color,
|
&color,
|
||||||
node);
|
node);
|
||||||
|
|
||||||
@ -3125,7 +3100,6 @@ _clutter_actor_draw_paint_volume (ClutterActor *self,
|
|||||||
{
|
{
|
||||||
clutter_color_init (&color, 0, 255, 0, 255);
|
clutter_color_init (&color, 0, 255, 0, 255);
|
||||||
_clutter_actor_draw_paint_volume_full (self, pv,
|
_clutter_actor_draw_paint_volume_full (self, pv,
|
||||||
_clutter_actor_get_debug_name (self),
|
|
||||||
&color,
|
&color,
|
||||||
node);
|
node);
|
||||||
}
|
}
|
||||||
@ -3137,7 +3111,6 @@ _clutter_actor_paint_cull_result (ClutterActor *self,
|
|||||||
ClutterCullResult result,
|
ClutterCullResult result,
|
||||||
ClutterPaintNode *node)
|
ClutterPaintNode *node)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv = self->priv;
|
|
||||||
ClutterPaintVolume *pv;
|
ClutterPaintVolume *pv;
|
||||||
ClutterColor color;
|
ClutterColor color;
|
||||||
|
|
||||||
@ -3161,40 +3134,8 @@ _clutter_actor_paint_cull_result (ClutterActor *self,
|
|||||||
|
|
||||||
if (success && (pv = _clutter_actor_get_paint_volume_mutable (self)))
|
if (success && (pv = _clutter_actor_get_paint_volume_mutable (self)))
|
||||||
_clutter_actor_draw_paint_volume_full (self, pv,
|
_clutter_actor_draw_paint_volume_full (self, pv,
|
||||||
_clutter_actor_get_debug_name (self),
|
|
||||||
&color,
|
&color,
|
||||||
node);
|
node);
|
||||||
else
|
|
||||||
{
|
|
||||||
g_autoptr (ClutterPaintNode) text_node = NULL;
|
|
||||||
PangoLayout *layout;
|
|
||||||
float width;
|
|
||||||
float height;
|
|
||||||
char *label =
|
|
||||||
g_strdup_printf ("CULL FAILURE: %s", _clutter_actor_get_debug_name (self));
|
|
||||||
clutter_color_init (&color, 255, 255, 255, 255);
|
|
||||||
|
|
||||||
width = clutter_actor_box_get_width (&priv->allocation);
|
|
||||||
height = clutter_actor_box_get_height (&priv->allocation);
|
|
||||||
|
|
||||||
layout = pango_layout_new (clutter_actor_get_pango_context (self));
|
|
||||||
pango_layout_set_text (layout, label, -1);
|
|
||||||
|
|
||||||
text_node = clutter_text_node_new (layout, &color);
|
|
||||||
clutter_paint_node_set_static_name (text_node,
|
|
||||||
"ClutterActor (paint volume text)");
|
|
||||||
clutter_paint_node_add_rectangle (text_node,
|
|
||||||
&(ClutterActorBox) {
|
|
||||||
.x1 = 0.f,
|
|
||||||
.y1 = 0.f,
|
|
||||||
.x2 = width,
|
|
||||||
.y2 = height,
|
|
||||||
});
|
|
||||||
clutter_paint_node_add_child (node, text_node);
|
|
||||||
|
|
||||||
g_free (label);
|
|
||||||
g_object_unref (layout);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int clone_paint_level = 0;
|
static int clone_paint_level = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user