cssnode: Change the way we invalidate timestamps

Do not propagate the TIMESTAMP change through the node tree, as that
causes lots of uneeded markings of nodes as invalid.

Instead, walk the node tree and find the nodes that have a non-static
style and only invalidate timestamps on those.
This commit is contained in:
Benjamin Otte
2015-02-28 02:22:38 +01:00
parent 759d8dafd9
commit d785820c53

View File

@ -841,6 +841,23 @@ gtk_css_node_invalidate_style_provider (GtkCssNode *cssnode)
} }
} }
static void
gtk_css_node_invalidate_timestamp (GtkCssNode *cssnode)
{
GtkCssNode *child;
if (!cssnode->invalid)
return;
if (!gtk_css_style_is_static (cssnode->style))
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP);
for (child = cssnode->first_child; child; child = child->next_sibling)
{
gtk_css_node_invalidate_timestamp (child);
}
}
void void
gtk_css_node_invalidate_frame_clock (GtkCssNode *cssnode, gtk_css_node_invalidate_frame_clock (GtkCssNode *cssnode,
gboolean just_timestamp) gboolean just_timestamp)
@ -849,10 +866,10 @@ gtk_css_node_invalidate_frame_clock (GtkCssNode *cssnode,
if (cssnode->parent) if (cssnode->parent)
return; return;
if (just_timestamp) gtk_css_node_invalidate_timestamp (cssnode);
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP);
else if (!just_timestamp)
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_TIMESTAMP | GTK_CSS_CHANGE_ANIMATIONS); gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_ANIMATIONS);
} }
void void