[Bf-blender-cvs] [cf84db61a6b] master: Depsgraph: Refactor, move debug struct to own file

Sergey Sharybin noreply at git.blender.org
Fri Jan 24 12:44:35 CET 2020


Commit: cf84db61a6baf160fc3521e5b5a4121609b9ea8d
Author: Sergey Sharybin
Date:   Fri Jan 24 11:26:15 2020 +0100
Branches: master
https://developer.blender.org/rBcf84db61a6baf160fc3521e5b5a4121609b9ea8d

Depsgraph: Refactor, move debug struct to own file

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

M	source/blender/depsgraph/intern/debug/deg_debug.cc
M	source/blender/depsgraph/intern/debug/deg_debug.h
M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph.h

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

diff --git a/source/blender/depsgraph/intern/debug/deg_debug.cc b/source/blender/depsgraph/intern/debug/deg_debug.cc
index b811f11f721..b8db18c9958 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug.cc
@@ -32,6 +32,10 @@
 
 namespace DEG {
 
+DepsgraphDebug::DepsgraphDebug() : flags(G.debug)
+{
+}
+
 bool terminal_do_color(void)
 {
   return (G.debug & G_DEBUG_DEPSGRAPH_PRETTY) != 0;
diff --git a/source/blender/depsgraph/intern/debug/deg_debug.h b/source/blender/depsgraph/intern/debug/deg_debug.h
index 3e4da644641..90a2f7a25fd 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug.h
+++ b/source/blender/depsgraph/intern/debug/deg_debug.h
@@ -31,6 +31,17 @@
 
 namespace DEG {
 
+struct DepsgraphDebug {
+  DepsgraphDebug();
+
+  /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
+  int flags;
+
+  /* Name of this dependency graph (is used for debug prints, helping to distinguish graphs
+   * created for different view layer). */
+  string name;
+};
+
 #define DEG_DEBUG_PRINTF(depsgraph, type, ...) \
   do { \
     if (DEG_debug_flags_get(depsgraph) & G_DEBUG_DEPSGRAPH_##type) { \
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 0e929f4e8b6..7e26857e440 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -83,7 +83,6 @@ Depsgraph::Depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluati
   BLI_spin_init(&lock);
   id_hash = BLI_ghash_ptr_new("Depsgraph id hash");
   entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags");
-  debug.flags = G.debug;
   memset(id_type_updated, 0, sizeof(id_type_updated));
   memset(id_type_exist, 0, sizeof(id_type_exist));
   memset(physics_relations, 0, sizeof(physics_relations));
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 89c5af9c798..a7ee5612af4 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -40,6 +40,7 @@
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_physics.h"
 
+#include "intern/debug/deg_debug.h"
 #include "intern/depsgraph_type.h"
 
 struct GHash;
@@ -156,14 +157,7 @@ struct Depsgraph {
    * to read stuff from. */
   bool is_active;
 
-  struct {
-    /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
-    int flags;
-
-    /* Name of this dependency graph (is used for debug prints, helping to distinguish graphs
-     * created for different view layer). */
-    string name;
-  } debug;
+  DepsgraphDebug debug;
 
   bool is_evaluating;



More information about the Bf-blender-cvs mailing list