From d57cb8fa22eb757e0960cb1336f00e495519a939 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Sep 2018 14:35:42 +0200 Subject: Depsgraph: Use more meaningful name for flags storage --- .../blender/depsgraph/intern/depsgraph_query_foreach.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source/blender/depsgraph/intern/depsgraph_query_foreach.cc') diff --git a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc index c8aaf353874..b6138e4e81c 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc @@ -60,6 +60,9 @@ extern "C" { namespace DEG { typedef std::deque TraversalQueue; +enum { + DEG_NODE_VISITED = (1 << 0), +}; static void deg_foreach_clear_flags(const Depsgraph *graph) { @@ -67,7 +70,7 @@ static void deg_foreach_clear_flags(const Depsgraph *graph) op_node->scheduled = false; } foreach (IDDepsNode *id_node, graph->id_nodes) { - id_node->done = false; + id_node->custom_flags = 0; } } @@ -96,7 +99,7 @@ static void deg_foreach_dependent_ID(const Depsgraph *graph, } } GHASH_FOREACH_END(); - target_id_node->done = true; + target_id_node->custom_flags |= DEG_NODE_VISITED; /* Process the queue. */ while (!queue.empty()) { /* get next operation node to process. */ @@ -106,10 +109,10 @@ static void deg_foreach_dependent_ID(const Depsgraph *graph, /* Check whether we need to inform callee about corresponding ID node. */ ComponentDepsNode *comp_node = op_node->owner; IDDepsNode *id_node = comp_node->owner; - if (!id_node->done) { + if ((id_node->custom_flags & DEG_NODE_VISITED) == 0) { /* TODO(sergey): Is it orig or CoW? */ callback(id_node->id_orig, user_data); - id_node->done = true; + id_node->custom_flags |= DEG_NODE_VISITED; } /* Schedule outgoing operation nodes. */ if (op_node->outlinks.size() == 1) { @@ -161,7 +164,7 @@ static void deg_foreach_ancestor_ID(const Depsgraph *graph, } } GHASH_FOREACH_END(); - target_id_node->done = true; + target_id_node->custom_flags |= DEG_NODE_VISITED; /* Process the queue. */ while (!queue.empty()) { /* get next operation node to process. */ @@ -171,10 +174,10 @@ static void deg_foreach_ancestor_ID(const Depsgraph *graph, /* Check whether we need to inform callee about corresponding ID node. */ ComponentDepsNode *comp_node = op_node->owner; IDDepsNode *id_node = comp_node->owner; - if (!id_node->done) { + if ((id_node->custom_flags & DEG_NODE_VISITED) == 0) { /* TODO(sergey): Is it orig or CoW? */ callback(id_node->id_orig, user_data); - id_node->done = true; + id_node->custom_flags |= DEG_NODE_VISITED; } /* Schedule incoming operation nodes. */ if (op_node->inlinks.size() == 1) { -- cgit v1.2.3