[Bf-blender-cvs] [cc5a053] depsgraph_refactor: Exit from the task run function early in case of NOOP.

Lukas Tönne noreply at git.blender.org
Mon May 26 17:24:29 CEST 2014


Commit: cc5a053abf41ae0775d9b59baf7f0c514b2e8130
Author: Lukas Tönne
Date:   Mon May 26 17:09:38 2014 +0200
https://developer.blender.org/rBcc5a053abf41ae0775d9b59baf7f0c514b2e8130

Exit from the task run function early in case of NOOP.

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

M	source/blender/depsgraph/util/depsgraph_util_task.cpp

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

diff --git a/source/blender/depsgraph/util/depsgraph_util_task.cpp b/source/blender/depsgraph/util/depsgraph_util_task.cpp
index 797c5b9..9c279c6 100644
--- a/source/blender/depsgraph/util/depsgraph_util_task.cpp
+++ b/source/blender/depsgraph/util/depsgraph_util_task.cpp
@@ -42,23 +42,23 @@ DepsgraphTask::DepsgraphTask(Depsgraph *graph_, OperationDepsNode *node_, eEvalu
 
 void DepsgraphTask::run()
 {
-	/* get context and dispatch */
-	ComponentDepsNode *comp = node->owner; 
-	void *context = NULL, *item = NULL;
+	if (node->is_noop())
+		return;
 	
 	/* get context */
 	// TODO: who initialises this? "Init" operations aren't able to initialise it!!!
+	ComponentDepsNode *comp = node->owner; 
 	BLI_assert(comp != NULL);
-	context = comp->contexts[context_type];
+	void *context = comp->contexts[context_type];
 	
 	/* get "item" */
 	// XXX: not everything will use this - some may want something else!
-	item = &node->ptr;
+	void *item = &node->ptr;
 	
 	/* take note of current time */
 //	node->start_time = PIL_check_seconds_timer();
 	
-	/* NOOPs should not be evaluated */
+	/* should only be the case for NOOPs, which never get to this point */
 	BLI_assert(node->evaluate);
 	/* perform operation */
 	node->evaluate(context, item);




More information about the Bf-blender-cvs mailing list