snapshot: Use collect_default directoy in push_debug()
Instead of going through collect_debug and then doing a collect_default anyway if the message is NULL.
This commit is contained in:
@@ -351,9 +351,6 @@ gtk_snapshot_collect_debug (GtkSnapshot *snapshot,
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
if (state->data.debug.message == NULL)
|
||||
return node;
|
||||
|
||||
debug_node = gsk_debug_node_new (node, state->data.debug.message);
|
||||
|
||||
gsk_render_node_unref (node);
|
||||
@@ -377,15 +374,17 @@ gtk_snapshot_push_debug (GtkSnapshot *snapshot,
|
||||
...)
|
||||
{
|
||||
GtkSnapshotState *current_state = gtk_snapshot_get_current_state (snapshot);
|
||||
|
||||
if (GTK_DEBUG_CHECK (SNAPSHOT))
|
||||
{
|
||||
va_list args;
|
||||
GtkSnapshotState *state;
|
||||
|
||||
state = gtk_snapshot_push_state (snapshot,
|
||||
current_state->transform,
|
||||
gtk_snapshot_collect_debug);
|
||||
|
||||
if (GTK_DEBUG_CHECK (SNAPSHOT))
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
||||
va_start (args, message);
|
||||
state->data.debug.message = g_strdup_vprintf (message, args);
|
||||
@@ -393,7 +392,9 @@ gtk_snapshot_push_debug (GtkSnapshot *snapshot,
|
||||
}
|
||||
else
|
||||
{
|
||||
state->data.debug.message = NULL;
|
||||
gtk_snapshot_push_state (snapshot,
|
||||
current_state->transform,
|
||||
gtk_snapshot_collect_default);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user