[Bf-blender-cvs] [07b9476] depsgraph_refactor: Made the DEG_node_tag_update function an internal method of Depsgraph.

Lukas Tönne noreply at git.blender.org
Wed Apr 16 08:58:44 CEST 2014


Commit: 07b9476bde36943b964c84ace1d3a21559dfe520
Author: Lukas Tönne
Date:   Mon Apr 14 13:55:01 2014 +0200
https://developer.blender.org/rB07b9476bde36943b964c84ace1d3a21559dfe520

Made the DEG_node_tag_update function an internal method of Depsgraph.

It flags the node and also adds it to the Depsgraph entry_tags list, so
putting it into Depsnode itself is not really feasible.

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

M	source/blender/depsgraph/intern/depsgraph.cpp
M	source/blender/depsgraph/intern/depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_eval.cpp
M	source/blender/depsgraph/intern/depsgraph_eval.h
M	source/blender/depsgraph/intern/depsgraph_tag.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph.cpp b/source/blender/depsgraph/intern/depsgraph.cpp
index 1240d49..c920b12 100644
--- a/source/blender/depsgraph/intern/depsgraph.cpp
+++ b/source/blender/depsgraph/intern/depsgraph.cpp
@@ -268,6 +268,24 @@ DepsRelation::~DepsRelation()
 	this->to->inlinks.erase(this);
 }
 
+/* Low level tagging -------------------------------------- */
+
+/* Tag a specific node as needing updates */
+void Depsgraph::tag_update(DepsNode *node)
+{
+	/* sanity check */
+	if (!node)
+		return;
+	
+	/* tag for update, but also not that this was the source of an update */
+	node->flag |= (DEPSNODE_FLAG_NEEDS_UPDATE | DEPSNODE_FLAG_DIRECTLY_MODIFIED);
+	
+	/* add to graph-level set of directly modified nodes to start searching from
+	 * NOTE: this is necessary since we have several thousand nodes to play with...
+	 */
+	this->entry_tags.insert(node);
+}
+
 /* ************************************************** */
 /* Public Graph API */
 
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 6b67ac1..30d201a 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -150,6 +150,9 @@ struct Depsgraph {
 	 */
 	void sort();
 	
+	/* Tag a specific node as needing updates */
+	void tag_update(DepsNode *node);
+	
 	
 	/* Core Graph Functionality ........... */
 	IDNodeMap id_hash;          /* <ID : IDDepsNode> mapping from ID blocks to nodes representing these blocks (for quick lookups) */
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index ded973d..4f057ee 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -153,7 +153,7 @@ void DEG_evaluate_on_framechange(Depsgraph *graph, eEvaluationContextType contex
 	tsrc = (TimeSourceDepsNode *)graph->find_node(NULL, "", DEPSNODE_TYPE_TIMESOURCE, "");
 	tsrc->cfra = ctime;
 	
-	DEG_node_tag_update(graph, tsrc);
+	graph->tag_update(tsrc);
 	
 	/* recursively push updates out to all nodes dependent on this, 
 	 * until all affected are tagged and/or scheduled up for eval
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.h b/source/blender/depsgraph/intern/depsgraph_eval.h
index b00aae3..72afad2 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.h
+++ b/source/blender/depsgraph/intern/depsgraph_eval.h
@@ -123,11 +123,5 @@ typedef struct DEG_PoseContext {
 } DEG_PoseContext;
 
 /* ****************************************** */
-/* Tagging */
-
-/* Tag a specific node as needing updates */
-void DEG_node_tag_update(Depsgraph *graph, DepsNode *node);
-
-/* ****************************************** */
 
 #endif // __DEPSGRAPH_EVAL_TYPES_H__
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cpp b/source/blender/depsgraph/intern/depsgraph_tag.cpp
index 58b6237..1cbb26d 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cpp
@@ -51,24 +51,6 @@ extern "C" {
 /* ************************************************** */
 /* Update Tagging/Flushing */
 
-/* Low-Level Tagging -------------------------------- */
-
-/* Tag a specific node as needing updates */
-void DEG_node_tag_update(Depsgraph *graph, DepsNode *node)
-{
-	/* sanity check */
-	if (ELEM(NULL, graph, node))
-		return;
-		
-	/* tag for update, but also not that this was the source of an update */
-	node->flag |= (DEPSNODE_FLAG_NEEDS_UPDATE | DEPSNODE_FLAG_DIRECTLY_MODIFIED);
-	
-	/* add to graph-level set of directly modified nodes to start searching from
-	 * NOTE: this is necessary since we have several thousand nodes to play with...
-	 */
-	graph->entry_tags.insert(node);
-}
-
 /* Data-Based Tagging ------------------------------- */
 
 /* Tag all nodes in ID-block for update 
@@ -77,21 +59,21 @@ void DEG_node_tag_update(Depsgraph *graph, DepsNode *node)
 void DEG_id_tag_update(Depsgraph *graph, const ID *id)
 {
 	DepsNode *node = graph->find_node(id, "", DEPSNODE_TYPE_ID_REF, "");
-	DEG_node_tag_update(graph, node);
+	graph->tag_update(node);
 }
 
 /* Tag nodes related to a specific piece of data */
 void DEG_data_tag_update(Depsgraph *graph, const PointerRNA *ptr)
 {
 	DepsNode *node = graph->find_node_from_pointer(ptr, NULL);
-	DEG_node_tag_update(graph, node);
+	graph->tag_update(node);
 }
 
 /* Tag nodes related to a specific property */
 void DEG_property_tag_update(Depsgraph *graph, const PointerRNA *ptr, const PropertyRNA *prop)
 {
 	DepsNode *node = graph->find_node_from_pointer(ptr, prop);
-	DEG_node_tag_update(graph, node);
+	graph->tag_update(node);
 }
 
 /* Update Flushing ---------------------------------- */




More information about the Bf-blender-cvs mailing list