From 53d69e6d048f918b2c9ee61d3e9f27db64fdfa52 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 23 Apr 2018 16:42:37 +0200 Subject: Depsgraph: Add relation flag to avoid flush across it This way we can avoid re-evaluation of certain parts of datablock when something unrelated has changed. --- .../intern/debug/deg_debug_relations_graphviz.cc | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc') diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index 7b93434710b..80772f9595f 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -256,6 +256,18 @@ static void deg_debug_graphviz_relation_color(const DebugContext &ctx, deg_debug_fprintf(ctx, "%s", color); } +static void deg_debug_graphviz_relation_style(const DebugContext &ctx, + const DepsRelation *rel) +{ + const char *style_default = "solid"; + const char *style_no_flush = "dashed"; + const char *style = style_default; + if (rel->flag & DEPSREL_FLAG_NO_FLUSH) { + style = style_no_flush; + } + deg_debug_fprintf(ctx, "%s", style); +} + static void deg_debug_graphviz_node_style(const DebugContext &ctx, const DepsNode *node) { const char *base_style = "filled"; /* default style */ @@ -469,16 +481,23 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx, /* Note: without label an id seem necessary to avoid bugs in graphviz/dot */ deg_debug_fprintf(ctx, "id=\"%s\"", rel->name); // deg_debug_fprintf(ctx, "label=\"%s\"", rel->name); - deg_debug_fprintf(ctx, ",color="); deg_debug_graphviz_relation_color(ctx, rel); + deg_debug_fprintf(ctx, ",color="); + deg_debug_graphviz_relation_color(ctx, rel); + deg_debug_fprintf(ctx, ",style="); + deg_debug_graphviz_relation_style(ctx, rel); deg_debug_fprintf(ctx, ",penwidth=\"%f\"", penwidth); /* NOTE: edge from node to own cluster is not possible and gives graphviz * warning, avoid this here by just linking directly to the invisible * placeholder node */ - if (deg_debug_graphviz_is_cluster(tail) && !deg_debug_graphviz_is_owner(head, tail)) { + if (deg_debug_graphviz_is_cluster(tail) && + !deg_debug_graphviz_is_owner(head, tail)) + { deg_debug_fprintf(ctx, ",ltail=\"cluster_%p\"", tail); } - if (deg_debug_graphviz_is_cluster(head) && !deg_debug_graphviz_is_owner(tail, head)) { + if (deg_debug_graphviz_is_cluster(head) && + !deg_debug_graphviz_is_owner(tail, head)) + { deg_debug_fprintf(ctx, ",lhead=\"cluster_%p\"", head); } deg_debug_fprintf(ctx, "];" NL); -- cgit v1.2.3