[Bf-blender-cvs] [8534fb1b01d] master: Depsgraph: Cleanup, move private functions to anonymous namespace

Sergey Sharybin noreply at git.blender.org
Tue Jan 7 12:21:35 CET 2020


Commit: 8534fb1b01d556e64846e26f8135201bc2d46c1a
Author: Sergey Sharybin
Date:   Tue Jan 7 11:56:55 2020 +0100
Branches: master
https://developer.blender.org/rB8534fb1b01d556e64846e26f8135201bc2d46c1a

Depsgraph: Cleanup, move private functions to anonymous namespace

Allows to have shorter definition lines.

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

M	source/blender/depsgraph/intern/eval/deg_eval.cc

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

diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc
index d6b3c54a149..b2e6e765328 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval.cc
@@ -54,14 +54,9 @@
 
 namespace DEG {
 
-/* ********************** */
-/* Evaluation Entrypoints */
+namespace {
 
-/* Forward declarations. */
-static void schedule_children(TaskPool *pool,
-                              Depsgraph *graph,
-                              OperationNode *node,
-                              const int thread_id);
+void schedule_children(TaskPool *pool, Depsgraph *graph, OperationNode *node, const int thread_id);
 
 struct DepsgraphEvalState {
   Depsgraph *graph;
@@ -69,7 +64,7 @@ struct DepsgraphEvalState {
   bool is_cow_stage;
 };
 
-static void deg_task_run_func(TaskPool *pool, void *taskdata, int thread_id)
+void deg_task_run_func(TaskPool *pool, void *taskdata, int thread_id)
 {
   void *userdata_v = BLI_task_pool_userdata(pool);
   DepsgraphEvalState *state = (DepsgraphEvalState *)userdata_v;
@@ -91,7 +86,7 @@ static void deg_task_run_func(TaskPool *pool, void *taskdata, int thread_id)
   BLI_task_pool_delayed_push_end(pool, thread_id);
 }
 
-static bool check_operation_node_visible(OperationNode *op_node)
+bool check_operation_node_visible(OperationNode *op_node)
 {
   const ComponentNode *comp_node = op_node->owner;
   /* Special exception, copy on write component is to be always evaluated,
@@ -102,7 +97,7 @@ static bool check_operation_node_visible(OperationNode *op_node)
   return comp_node->affects_directly_visible;
 }
 
-static void calculate_pending_parents_for_node(OperationNode *node)
+void calculate_pending_parents_for_node(OperationNode *node)
 {
   /* Update counters, applies for both visible and invisible IDs. */
   node->num_links_pending = 0;
@@ -134,14 +129,14 @@ static void calculate_pending_parents_for_node(OperationNode *node)
   }
 }
 
-static void calculate_pending_parents(Depsgraph *graph)
+void calculate_pending_parents(Depsgraph *graph)
 {
   for (OperationNode *node : graph->operations) {
     calculate_pending_parents_for_node(node);
   }
 }
 
-static void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph)
+void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph)
 {
   const bool do_stats = state->do_stats;
   calculate_pending_parents(graph);
@@ -157,7 +152,7 @@ static void initialize_execution(DepsgraphEvalState *state, Depsgraph *graph)
  *   dec_parents: Decrement pending parents count, true when child nodes are
  *                scheduled after a task has been completed.
  */
-static void schedule_node(
+void schedule_node(
     TaskPool *pool, Depsgraph *graph, OperationNode *node, bool dec_parents, const int thread_id)
 {
   /* No need to schedule nodes of invisible ID. */
@@ -205,17 +200,14 @@ static void schedule_node(
   }
 }
 
-static void schedule_graph(TaskPool *pool, Depsgraph *graph)
+void schedule_graph(TaskPool *pool, Depsgraph *graph)
 {
   for (OperationNode *node : graph->operations) {
     schedule_node(pool, graph, node, false, -1);
   }
 }
 
-static void schedule_children(TaskPool *pool,
-                              Depsgraph *graph,
-                              OperationNode *node,
-                              const int thread_id)
+void schedule_children(TaskPool *pool, Depsgraph *graph, OperationNode *node, const int thread_id)
 {
   for (Relation *rel : node->outlinks) {
     OperationNode *child = (OperationNode *)rel->to;
@@ -228,7 +220,7 @@ static void schedule_children(TaskPool *pool,
   }
 }
 
-static void depsgraph_ensure_view_layer(Depsgraph *graph)
+void depsgraph_ensure_view_layer(Depsgraph *graph)
 {
   /* We update copy-on-write scene in the following cases:
    * - It was not expanded yet.
@@ -242,6 +234,8 @@ static void depsgraph_ensure_view_layer(Depsgraph *graph)
   }
 }
 
+}  // namespace
+
 /**
  * Evaluate all nodes tagged for updating,
  * \warning This is usually done as part of main loop, but may also be



More information about the Bf-blender-cvs mailing list