diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-03 15:35:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-03 16:20:06 +0300 |
commit | d57cb8fa22eb757e0960cb1336f00e495519a939 (patch) | |
tree | 0b8c3267b56524233f36c766a80a3d17c5523d4d /source/blender/depsgraph/intern/depsgraph_query_foreach.cc | |
parent | e152483a320d2da88199697da02ddb2befc73778 (diff) |
Depsgraph: Use more meaningful name for flags storage
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_query_foreach.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query_foreach.cc | 17 |
1 files changed, 10 insertions, 7 deletions
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<OperationDepsNode *> 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) { |