[Bf-blender-cvs] [4ca5581] depsgraph_cleanup: Depsgraph: Move clear update tags function to eval

Sergey Sharybin noreply at git.blender.org
Thu May 26 10:02:38 CEST 2016


Commit: 4ca5581af96267f8b2bb33486d942bf2f9855ffb
Author: Sergey Sharybin
Date:   Wed May 25 17:24:34 2016 +0200
Branches: depsgraph_cleanup
https://developer.blender.org/rB4ca5581af96267f8b2bb33486d942bf2f9855ffb

Depsgraph: Move clear update tags function to eval

It's not really a flush part of evaluation, but close enough.

No need to keep in a public API anyway.

===================================================================

M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_tag.cc
M	source/blender/depsgraph/intern/eval/deg_eval.cc
M	source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M	source/blender/depsgraph/intern/eval/deg_eval_flush.h

===================================================================

diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index 79b0f5c..d1de83e 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -141,11 +141,6 @@ void DEG_ids_check_recalc(struct Main *bmain,
                           struct Scene *scene,
                           bool time);
 
-/* Clear all update tags
- * - For aborted updates, or after successful evaluation
- */
-void DEG_graph_clear_tags(Depsgraph *graph);
-
 /* ************************************************ */
 /* Evaluation Engine API */
 
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index e74b064..e063c22 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -277,25 +277,6 @@ void DEG_ids_flush_tagged(Main *bmain)
 	}
 }
 
-static void graph_clear_func(void *data_v, int i)
-{
-	Depsgraph *graph = (Depsgraph *)data_v;
-	OperationDepsNode *node = graph->operations[i];
-	/* Clear node's "pending update" settings. */
-	node->flag &= ~(DEPSOP_FLAG_DIRECTLY_MODIFIED | DEPSOP_FLAG_NEEDS_UPDATE);
-}
-
-/* Clear tags from all operation nodes. */
-void DEG_graph_clear_tags(Depsgraph *graph)
-{
-	/* Go over all operation nodes, clearing tags. */
-	const int num_operations = graph->operations.size();
-	const bool do_threads = num_operations > 256;
-	BLI_task_parallel_range(0, num_operations, graph, graph_clear_func, do_threads);
-	/* Clear any entry tags which haven't been flushed. */
-	graph->entry_tags.clear();
-}
-
 /* Update dependency graph when visible scenes/layers changes. */
 void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
 {
diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index 340ef49..ba4ae6a 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -403,7 +403,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx,
 	DepsgraphDebug::eval_end(eval_ctx);
 
 	/* Clear any uncleared tags - just in case. */
-	DEG_graph_clear_tags(graph);
+	deg_graph_clear_tags(graph);
 }
 
 }  // namespace DEG
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 4b5233e..9804567 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -188,4 +188,23 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
 	}
 }
 
+static void graph_clear_func(void *data_v, int i)
+{
+	Depsgraph *graph = (Depsgraph *)data_v;
+	OperationDepsNode *node = graph->operations[i];
+	/* Clear node's "pending update" settings. */
+	node->flag &= ~(DEPSOP_FLAG_DIRECTLY_MODIFIED | DEPSOP_FLAG_NEEDS_UPDATE);
+}
+
+/* Clear tags from all operation nodes. */
+void deg_graph_clear_tags(Depsgraph *graph)
+{
+	/* Go over all operation nodes, clearing tags. */
+	const int num_operations = graph->operations.size();
+	const bool do_threads = num_operations > 256;
+	BLI_task_parallel_range(0, num_operations, graph, graph_clear_func, do_threads);
+	/* Clear any entry tags which haven't been flushed. */
+	graph->entry_tags.clear();
+}
+
 }  // namespace DEG
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.h b/source/blender/depsgraph/intern/eval/deg_eval_flush.h
index 6098c02..a5f7faa 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.h
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.h
@@ -40,6 +40,9 @@ namespace DEG {
 /* Flush updates from tagged nodes outwards until all affected nodes
  * are tagged.
  */
-void deg_graph_flush_updates(Main *bmain, Depsgraph *graph);
+void deg_graph_flush_updates(struct Main *bmain, struct Depsgraph *graph);
+
+/* Clear tags from all operation nodes. */
+void deg_graph_clear_tags(struct Depsgraph *graph);
 
 }  // namespace DEG




More information about the Bf-blender-cvs mailing list