Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-30 10:18:40 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-30 17:03:43 +0300
commite125c9329d44ec096199618d7880c0212e0f8176 (patch)
treecd04d9a40f18045a10c3f8e83c48471dd5d96586 /source/blender/compositor/intern
parent3ead9b2b3605580554cc330d2d2525f405e9c779 (diff)
Fix: Compile Error COM_Debug.
We should replace `ifdef COM_Debug` with a constexpr function.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_Debug.cc57
-rw-r--r--source/blender/compositor/intern/COM_Debug.h2
2 files changed, 29 insertions, 30 deletions
diff --git a/source/blender/compositor/intern/COM_Debug.cc b/source/blender/compositor/intern/COM_Debug.cc
index 1612072a2e8..56bc2dc947f 100644
--- a/source/blender/compositor/intern/COM_Debug.cc
+++ b/source/blender/compositor/intern/COM_Debug.cc
@@ -18,32 +18,31 @@
#include "COM_Debug.h"
-namespace blender::compositor {
-
-#ifdef COM_DEBUG
-
-# include <map>
-# include <typeinfo>
-# include <vector>
+#include <map>
+#include <typeinfo>
+#include <vector>
extern "C" {
-# include "BLI_fileops.h"
-# include "BLI_path_util.h"
-# include "BLI_string.h"
-# include "BLI_sys_types.h"
-
-# include "BKE_appdir.h"
-# include "BKE_node.h"
-# include "DNA_node_types.h"
+#include "BLI_fileops.h"
+#include "BLI_path_util.h"
+#include "BLI_string.h"
+#include "BLI_sys_types.h"
+
+#include "BKE_appdir.h"
+#include "BKE_node.h"
+#include "DNA_node_types.h"
}
-# include "COM_ExecutionGroup.h"
-# include "COM_ExecutionSystem.h"
-# include "COM_Node.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_Node.h"
-# include "COM_ReadBufferOperation.h"
-# include "COM_ViewerOperation.h"
-# include "COM_WriteBufferOperation.h"
+#include "COM_ReadBufferOperation.h"
+#include "COM_ViewerOperation.h"
+#include "COM_WriteBufferOperation.h"
+
+namespace blender::compositor {
+
+#ifdef COM_DEBUG
int DebugInfo::m_file_index = 0;
DebugInfo::NodeNameMap DebugInfo::m_node_names;
@@ -115,7 +114,7 @@ void DebugInfo::execution_group_finished(const ExecutionGroup *group)
}
int DebugInfo::graphviz_operation(const ExecutionSystem *system,
- const NodeOperation *operation,
+ NodeOperation *operation,
const ExecutionGroup *group,
char *str,
int maxlen)
@@ -123,7 +122,7 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system,
int len = 0;
std::string fillcolor = "gainsboro";
- if (operation->isViewerOperation()) {
+ if (operation->get_flags().is_viewer_operation) {
const ViewerOperation *viewer = (const ViewerOperation *)operation;
if (viewer->isActiveViewerOutput()) {
fillcolor = "lightskyblue1";
@@ -135,7 +134,7 @@ int DebugInfo::graphviz_operation(const ExecutionSystem *system,
else if (operation->isOutputOperation(system->getContext().isRendering())) {
fillcolor = "dodgerblue1";
}
- else if (operation->get_flags().is_set_operation()) {
+ else if (operation->get_flags().is_set_operation) {
fillcolor = "khaki1";
}
else if (operation->get_flags().is_read_buffer_operation) {
@@ -383,8 +382,8 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
}
for (NodeOperation *op : system->m_operations) {
- for (NodeOperationInput *to : op->m_inputs) {
- NodeOperationOutput *from = to->getLink();
+ for (NodeOperationInput &to : op->m_inputs) {
+ NodeOperationOutput *from = to.getLink();
if (!from) {
continue;
@@ -403,7 +402,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
break;
}
- NodeOperation *to_op = &to->getOperation();
+ NodeOperation *to_op = &to.getOperation();
NodeOperation *from_op = &from->getOperation();
std::vector<std::string> &from_groups = op_groups[from_op];
std::vector<std::string> &to_groups = op_groups[to_op];
@@ -414,7 +413,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
from_op,
from,
to_op,
- to);
+ &to);
for (int k = 0; k < from_groups.size(); k++) {
for (int l = 0; l < to_groups.size(); l++) {
len += snprintf(str + len,
@@ -425,7 +424,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
from,
to_op,
to_groups[l].c_str(),
- to);
+ &to);
len += snprintf(
str + len, maxlen > len ? maxlen - len : 0, " [color=%s]", color.c_str());
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "\r\n");
diff --git a/source/blender/compositor/intern/COM_Debug.h b/source/blender/compositor/intern/COM_Debug.h
index 623e4332ac4..bf7b981fbd5 100644
--- a/source/blender/compositor/intern/COM_Debug.h
+++ b/source/blender/compositor/intern/COM_Debug.h
@@ -57,7 +57,7 @@ class DebugInfo {
#ifdef COM_DEBUG
protected:
static int graphviz_operation(const ExecutionSystem *system,
- const NodeOperation *operation,
+ NodeOperation *operation,
const ExecutionGroup *group,
char *str,
int maxlen);