diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-29 16:19:56 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-29 16:21:30 +0300 |
commit | cb5bfb32ba01705cf88e2c21eb61f7b9b24688da (patch) | |
tree | df4e98581ab00576a8625d5dc3f534bd964b21da /source/blender/depsgraph/intern/debug | |
parent | 81fb08ad57d6a71f40fa412ba14961a89cca0278 (diff) |
Depsgraph: introduce blender::deg namespace
Reviewers: sergey
Differential Revision: https://developer.blender.org/D8150
Diffstat (limited to 'source/blender/depsgraph/intern/debug')
5 files changed, 44 insertions, 30 deletions
diff --git a/source/blender/depsgraph/intern/debug/deg_debug.cc b/source/blender/depsgraph/intern/debug/deg_debug.cc index ca27cef2c56..ab6adea6416 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug.cc @@ -32,7 +32,8 @@ #include "BKE_global.h" -namespace DEG { +namespace blender { +namespace deg { DepsgraphDebug::DepsgraphDebug() : flags(G.debug), is_ever_evaluated(false), graph_evaluation_start_time_(0) @@ -97,4 +98,5 @@ string color_end(void) return string(TRUECOLOR_ANSI_COLOR_FINISH); } -} // namespace DEG +} // namespace deg +} // namespace blender diff --git a/source/blender/depsgraph/intern/debug/deg_debug.h b/source/blender/depsgraph/intern/debug/deg_debug.h index f5e2f2c4b51..043cdc85333 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug.h +++ b/source/blender/depsgraph/intern/debug/deg_debug.h @@ -30,7 +30,8 @@ #include "DEG_depsgraph_debug.h" -namespace DEG { +namespace blender { +namespace deg { class DepsgraphDebug { public: @@ -89,4 +90,5 @@ bool terminal_do_color(void); string color_for_pointer(const void *pointer); string color_end(void); -} // namespace DEG +} // namespace deg +} // namespace blender diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index 1f33bdefb79..458baf4fb1e 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -40,10 +40,13 @@ #include "intern/node/deg_node_operation.h" #include "intern/node/deg_node_time.h" +namespace deg = blender::deg; + /* ****************** */ /* Graphviz Debugging */ -namespace DEG { +namespace blender { +namespace deg { #define NL "\r\n" @@ -578,7 +581,8 @@ static void deg_debug_graphviz_graph_relations(const DebugContext &ctx, const De } } -} // namespace DEG +} // namespace deg +} // namespace blender void DEG_debug_relations_graphviz(const Depsgraph *graph, FILE *f, const char *label) { @@ -586,29 +590,29 @@ void DEG_debug_relations_graphviz(const Depsgraph *graph, FILE *f, const char *l return; } - const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast<const deg::Depsgraph *>(graph); - DEG::DebugContext ctx; + deg::DebugContext ctx; ctx.file = f; - DEG::deg_debug_fprintf(ctx, "digraph depgraph {" NL); - DEG::deg_debug_fprintf(ctx, "rankdir=LR;" NL); - DEG::deg_debug_fprintf(ctx, "graph ["); - DEG::deg_debug_fprintf(ctx, "compound=true"); - DEG::deg_debug_fprintf(ctx, ",labelloc=\"t\""); - DEG::deg_debug_fprintf(ctx, ",fontsize=%f", DEG::deg_debug_graphviz_graph_label_size); - DEG::deg_debug_fprintf(ctx, ",fontname=\"%s\"", DEG::deg_debug_graphviz_fontname); - DEG::deg_debug_fprintf(ctx, ",label=\"%s\"", label); - DEG::deg_debug_fprintf(ctx, ",splines=ortho"); - DEG::deg_debug_fprintf(ctx, ",overlap=scalexy"); // XXX: only when using neato - DEG::deg_debug_fprintf(ctx, "];" NL); + deg::deg_debug_fprintf(ctx, "digraph depgraph {" NL); + deg::deg_debug_fprintf(ctx, "rankdir=LR;" NL); + deg::deg_debug_fprintf(ctx, "graph ["); + deg::deg_debug_fprintf(ctx, "compound=true"); + deg::deg_debug_fprintf(ctx, ",labelloc=\"t\""); + deg::deg_debug_fprintf(ctx, ",fontsize=%f", deg::deg_debug_graphviz_graph_label_size); + deg::deg_debug_fprintf(ctx, ",fontname=\"%s\"", deg::deg_debug_graphviz_fontname); + deg::deg_debug_fprintf(ctx, ",label=\"%s\"", label); + deg::deg_debug_fprintf(ctx, ",splines=ortho"); + deg::deg_debug_fprintf(ctx, ",overlap=scalexy"); // XXX: only when using neato + deg::deg_debug_fprintf(ctx, "];" NL); - DEG::deg_debug_graphviz_graph_nodes(ctx, deg_graph); - DEG::deg_debug_graphviz_graph_relations(ctx, deg_graph); + deg::deg_debug_graphviz_graph_nodes(ctx, deg_graph); + deg::deg_debug_graphviz_graph_relations(ctx, deg_graph); - DEG::deg_debug_graphviz_legend(ctx); + deg::deg_debug_graphviz_legend(ctx); - DEG::deg_debug_fprintf(ctx, "}" NL); + deg::deg_debug_fprintf(ctx, "}" NL); } #undef NL 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 9e751093ae2..78525ba6b69 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc @@ -36,7 +36,10 @@ #define NL "\r\n" -namespace DEG { +namespace deg = blender::deg; + +namespace blender { +namespace deg { namespace { struct DebugContext { @@ -147,7 +150,8 @@ void deg_debug_stats_gnuplot(const DebugContext &ctx) } } // namespace -} // namespace DEG +} // namespace deg +} // namespace blender void DEG_debug_stats_gnuplot(const Depsgraph *depsgraph, FILE *f, @@ -157,10 +161,10 @@ void DEG_debug_stats_gnuplot(const Depsgraph *depsgraph, if (depsgraph == nullptr) { return; } - DEG::DebugContext ctx; + deg::DebugContext ctx; ctx.file = f; - ctx.graph = (DEG::Depsgraph *)depsgraph; + ctx.graph = (deg::Depsgraph *)depsgraph; ctx.label = label; ctx.output_filename = output_filename; - DEG::deg_debug_stats_gnuplot(ctx); + deg::deg_debug_stats_gnuplot(ctx); } diff --git a/source/blender/depsgraph/intern/debug/deg_time_average.h b/source/blender/depsgraph/intern/debug/deg_time_average.h index 9794e9a88c3..838ceff8d96 100644 --- a/source/blender/depsgraph/intern/debug/deg_time_average.h +++ b/source/blender/depsgraph/intern/debug/deg_time_average.h @@ -23,7 +23,8 @@ #pragma once -namespace DEG { +namespace blender { +namespace deg { // Utility class which takes care of calculating average of time series, such as // FPS counters. @@ -68,4 +69,5 @@ template<int MaxSamples> class AveragedTimeSampler { int next_sample_index_; }; -} // namespace DEG +} // namespace deg +} // namespace blender |