[Bf-blender-cvs] [3b3d0f3] depsgraph_refactor: Removed void context pointer and generic PointerRNA arguments from the operation functions.

Lukas Tönne noreply at git.blender.org
Tue Jun 10 19:56:45 CEST 2014


Commit: 3b3d0f3f71826f9bb20f39cb0fb56c67b77ca63e
Author: Lukas Tönne
Date:   Mon Jun 9 09:01:38 2014 +0200
https://developer.blender.org/rB3b3d0f3f71826f9bb20f39cb0fb56c67b77ca63e

Removed void context pointer and generic PointerRNA arguments from the
operation functions.

These functions are now plain lambdas without any arguments. They should
be bound to the appropriate fixed arguments on construction.

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

M	source/blender/depsgraph/intern/depsgraph_type_defines.cpp
M	source/blender/depsgraph/intern/depsgraph_types.h
M	source/blender/depsgraph/intern/depsnode_operation.h
M	source/blender/depsgraph/intern/stubs.h
M	source/blender/depsgraph/util/depsgraph_util_task.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
index fd01b97..6765ac9 100644
--- a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
@@ -61,32 +61,32 @@ extern "C" {
 
 #include "stubs.h" // XXX: THIS MUST BE REMOVED WHEN THE DEPSGRAPH REFACTOR IS DONE
 
-void BKE_animsys_eval_driver(void *context, PointerRNA *item) {}
+void BKE_animsys_eval_driver() {}
 
-void BKE_constraints_evaluate(void *context, PointerRNA *item) {}
-void BKE_pose_iktree_evaluate(void *context, PointerRNA *item) {}
-void BKE_pose_splineik_evaluate(void *context, PointerRNA *item) {}
-void BKE_pose_eval_bone(void *context, PointerRNA *item) {}
+void BKE_constraints_evaluate() {}
+void BKE_pose_iktree_evaluate() {}
+void BKE_pose_splineik_evaluate() {}
+void BKE_pose_eval_bone() {}
 
-void BKE_pose_rebuild_op(void *context, PointerRNA *item) {}
-void BKE_pose_eval_init(void *context, PointerRNA *item) {}
-void BKE_pose_eval_flush(void *context, PointerRNA *item) {}
+void BKE_pose_rebuild_op() {}
+void BKE_pose_eval_init() {}
+void BKE_pose_eval_flush() {}
 
-void BKE_particle_system_eval(void *context, PointerRNA *item) {}
+void BKE_particle_system_eval() {}
 
-void BKE_rigidbody_rebuild_sim(void *context, PointerRNA *item) {}
-void BKE_rigidbody_eval_simulation(void *context, PointerRNA *item) {}
-void BKE_rigidbody_object_sync_transforms(void *context, PointerRNA *item) {}
+void BKE_rigidbody_rebuild_sim() {}
+void BKE_rigidbody_eval_simulation() {}
+void BKE_rigidbody_object_sync_transforms() {}
 
-void BKE_object_eval_local_transform(void *context, PointerRNA *item) {}
-void BKE_object_eval_parent(void *context, PointerRNA *item) {}
-void BKE_object_eval_modifier(void *context, PointerRNA *item) {}
+void BKE_object_eval_local_transform() {}
+void BKE_object_eval_parent() {}
+void BKE_object_eval_modifier() {}
 
-void BKE_mesh_eval_geometry(void *context, PointerRNA *item) {}
-void BKE_mball_eval_geometry(void *context, PointerRNA *item) {}
-void BKE_curve_eval_geometry(void *context, PointerRNA *item) {}
-void BKE_curve_eval_path(void *context, PointerRNA *item) {}
-void BKE_lattice_eval_geometry(void *context, PointerRNA *item) {}
+void BKE_mesh_eval_geometry() {}
+void BKE_mball_eval_geometry() {}
+void BKE_curve_eval_geometry() {}
+void BKE_curve_eval_path() {}
+void BKE_lattice_eval_geometry() {}
 
 const string deg_op_name_object_parent = "BKE_object_eval_parent";
 const string deg_op_name_object_local_transform = "BKE_object_eval_local_transform";
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h
index b565b5a..3dcff4c 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -40,13 +40,9 @@ struct ChannelDriver;
 struct ModifierData;
 struct PointerRNA;
 
-/* Evaluation Operation for atomic operation 
- * < context: (ComponentEvalContext) context containing data necessary for performing this operation
- *            Results can generally be written to the context directly...
- * < (item): (ComponentDepsNode/PointerRNA) the specific entity involved, where applicable
- */
+/* Evaluation Operation for atomic operation */
 // XXX: move this to another header that can be exposed?
-typedef function<void(void *, PointerRNA *)> DepsEvalOperationCb;
+typedef function<void()> DepsEvalOperationCb;
 
 /* Metatype of Nodes - The general "level" in the graph structure the node serves */
 typedef enum eDepsNode_Class {
diff --git a/source/blender/depsgraph/intern/depsnode_operation.h b/source/blender/depsgraph/intern/depsnode_operation.h
index 12e000b..8abff50 100644
--- a/source/blender/depsgraph/intern/depsnode_operation.h
+++ b/source/blender/depsgraph/intern/depsnode_operation.h
@@ -69,7 +69,7 @@ struct OperationDepsNode : public DepsNode {
 	
 	void tag_update(Depsgraph *graph);
 	
-	bool is_noop() const { return evaluate == NULL; }
+	bool is_noop() const { return evaluate == false; }
 	
 	ComponentDepsNode *owner;     /* component that contains the operation */
 	
diff --git a/source/blender/depsgraph/intern/stubs.h b/source/blender/depsgraph/intern/stubs.h
index e4060fe..67b7df8 100644
--- a/source/blender/depsgraph/intern/stubs.h
+++ b/source/blender/depsgraph/intern/stubs.h
@@ -8,36 +8,34 @@
 #ifndef __DEPSGRAPH_FN_STUBS_H__
 #define __DEPSGRAPH_FN_STUBS_H__
 
-struct PointerRNA;
-
 #pragma message("DEPSGRAPH PORTING XXX: There are still some undefined stubs")
 
-void BKE_animsys_eval_driver(void *context, PointerRNA *item);
+void BKE_animsys_eval_driver();
 
-void BKE_constraints_evaluate(void *context, PointerRNA *item);
-void BKE_pose_iktree_evaluate(void *context, PointerRNA *item);
-void BKE_pose_splineik_evaluate(void *context, PointerRNA *item);
-void BKE_pose_eval_bone(void *context, PointerRNA *item);
+void BKE_constraints_evaluate();
+void BKE_pose_iktree_evaluate();
+void BKE_pose_splineik_evaluate();
+void BKE_pose_eval_bone();
 
-void BKE_pose_rebuild_op(void *context, PointerRNA *item);
-void BKE_pose_eval_init(void *context, PointerRNA *item);
-void BKE_pose_eval_flush(void *context, PointerRNA *item);
+void BKE_pose_rebuild_op();
+void BKE_pose_eval_init();
+void BKE_pose_eval_flush();
 
-void BKE_particle_system_eval(void *context, PointerRNA *item);
+void BKE_particle_system_eval();
 
-void BKE_rigidbody_rebuild_sim(void *context, PointerRNA *item); // BKE_rigidbody_rebuild_sim
-void BKE_rigidbody_eval_simulation(void *context, PointerRNA *item); // BKE_rigidbody_do_simulation
-void BKE_rigidbody_object_sync_transforms(void *context, PointerRNA *item); // BKE_rigidbody_sync_transforms
+void BKE_rigidbody_rebuild_sim(); // BKE_rigidbody_rebuild_sim
+void BKE_rigidbody_eval_simulation(); // BKE_rigidbody_do_simulation
+void BKE_rigidbody_object_sync_transforms(); // BKE_rigidbody_sync_transforms
 
-void BKE_object_eval_local_transform(void *context, PointerRNA *item);
-void BKE_object_eval_parent(void *context, PointerRNA *item);
-void BKE_object_eval_modifier(void *context, PointerRNA *item);
+void BKE_object_eval_local_transform();
+void BKE_object_eval_parent();
+void BKE_object_eval_modifier();
 
-void BKE_mesh_eval_geometry(void *context, PointerRNA *item);  // wrapper around makeDerivedMesh() - which gets BMesh, etc. data...
-void BKE_mball_eval_geometry(void *context, PointerRNA *item); // BKE_displist_make_mball
-void BKE_curve_eval_geometry(void *context, PointerRNA *item); // BKE_displist_make_curveTypes
-void BKE_curve_eval_path(void *context, PointerRNA *item);
-void BKE_lattice_eval_geometry(void *context, PointerRNA *item); // BKE_lattice_modifiers_calc
+void BKE_mesh_eval_geometry();  // wrapper around makeDerivedMesh() - which gets BMesh, etc. data...
+void BKE_mball_eval_geometry(); // BKE_displist_make_mball
+void BKE_curve_eval_geometry(); // BKE_displist_make_curveTypes
+void BKE_curve_eval_path();
+void BKE_lattice_eval_geometry(); // BKE_lattice_modifiers_calc
 
 #endif //__DEPSGRAPH_FN_STUBS_H__
 
diff --git a/source/blender/depsgraph/util/depsgraph_util_task.cpp b/source/blender/depsgraph/util/depsgraph_util_task.cpp
index b625dc9..6c03cf9 100644
--- a/source/blender/depsgraph/util/depsgraph_util_task.cpp
+++ b/source/blender/depsgraph/util/depsgraph_util_task.cpp
@@ -71,11 +71,6 @@ void DepsgraphTask::run()
 	// TODO: who initialises this? "Init" operations aren't able to initialise it!!!
 	ComponentDepsNode *comp = node->owner; 
 	BLI_assert(comp != NULL);
-	void *context = NULL; /* XXX TODO */
-	
-	/* get "item" */
-	// XXX: not everything will use this - some may want something else!
-	PointerRNA *item = &node->ptr;
 	
 	/* take note of current time */
 	double start_time = PIL_check_seconds_timer();
@@ -94,7 +89,7 @@ void DepsgraphTask::run()
 		/* should only be the case for NOOPs, which never get to this point */
 		BLI_assert(node->evaluate);
 		/* perform operation */
-		node->evaluate(context, item);
+		node->evaluate();
 	}
 	
 	/* note how long this took */




More information about the Bf-blender-cvs mailing list