diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 14:56:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 16:31:41 +0300 |
commit | c1da8e3b28f95188f9e9152383856c95f29586b4 (patch) | |
tree | 611acd206bfb126f076e78caa047b14bcd3673b6 /source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc | |
parent | 7ccef23c4d010d4b4f83efe2cd6c82ff26824a10 (diff) |
Depsgraph: Comb code to a better state all over
Some summary of changes:
- Don't use DEG prefix for types and enumerator values:
the code is already inside DEG namespace.
- Put code where it locally belongs to: avoid having one
single header file with all sort of definitions in it.
- Take advantage of modern C++11 enabled by default.
Diffstat (limited to 'source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc')
-rw-r--r-- | source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc index 0ea9f564fb1..e6b162b84a4 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc @@ -37,9 +37,7 @@ #include "BLI_math_base.h" #include "intern/depsgraph.h" -#include "intern/nodes/deg_node_id.h" - -#include "util/deg_util_foreach.h" +#include "intern/node/deg_node_id.h" extern "C" { #include "DNA_ID.h" @@ -58,7 +56,7 @@ struct DebugContext { }; struct StatsEntry { - const IDDepsNode *id_node; + const IDNode *id_node; double time; }; @@ -75,7 +73,7 @@ static void deg_debug_fprintf(const DebugContext &ctx, const char *fmt, ...) } BLI_INLINE double get_node_time(const DebugContext& /*ctx*/, - const DepsNode *node) + const Node *node) { // TODO(sergey): Figure out a nice way to define which exact time // we want to show. @@ -111,7 +109,7 @@ void write_stats_data(const DebugContext& ctx) // Fill in array of all stats which are to be displayed. vector<StatsEntry> stats; stats.reserve(ctx.graph->id_nodes.size()); - foreach (const IDDepsNode *id_node, ctx.graph->id_nodes) { + for (const IDNode *id_node : ctx.graph->id_nodes) { const double time = get_node_time(ctx, id_node); if (time == 0.0) { continue; @@ -128,7 +126,7 @@ void write_stats_data(const DebugContext& ctx) std::reverse(stats.begin(), stats.end()); // Print data to the file stream. deg_debug_fprintf(ctx, "$data << EOD" NL); - foreach (const StatsEntry& entry, stats) { + for (const StatsEntry& entry : stats) { deg_debug_fprintf( ctx, "\"[%s] %s\",%f" NL, gnuplotify_id_code(entry.id_node->id_orig->name).c_str(), |