From b12be5a872e308ee356b1da96a7f71346618b616 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 5 Mar 2021 10:41:45 +0100 Subject: Cleanup: Remove static struct without data. --- source/blender/compositor/intern/COM_Converter.cpp | 14 ++-- source/blender/compositor/intern/COM_Converter.h | 78 ++++++++-------------- .../compositor/intern/COM_ExecutionSystem.h | 2 +- source/blender/compositor/intern/COM_NodeGraph.cpp | 4 +- .../compositor/intern/COM_NodeOperationBuilder.cpp | 4 +- 5 files changed, 41 insertions(+), 61 deletions(-) (limited to 'source/blender/compositor/intern') diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 08035940667..c8ac86ccd5b 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -115,9 +115,9 @@ #include "COM_ViewerNode.h" #include "COM_ZCombineNode.h" -bool Converter::is_fast_node(bNode *b_node) +bool COM_bnode_is_fast_node(const bNode &b_node) { - return !ELEM(b_node->type, + return !ELEM(b_node.type, CMP_NODE_BLUR, CMP_NODE_VECBLUR, CMP_NODE_BILATERALBLUR, @@ -132,7 +132,7 @@ bool Converter::is_fast_node(bNode *b_node) CMP_NODE_DENOISE); } -Node *Converter::convert(bNode *b_node) +Node *COM_convert_bnode(bNode *b_node) { Node *node = nullptr; @@ -419,7 +419,7 @@ Node *Converter::convert(bNode *b_node) return node; } -NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperationInput *to) +NodeOperation *COM_convert_data_type(NodeOperationOutput *from, NodeOperationInput *to) { DataType fromDatatype = from->getDataType(); DataType toDatatype = to->getDataType(); @@ -446,9 +446,9 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati return nullptr; } -void Converter::convertResolution(NodeOperationBuilder &builder, - NodeOperationOutput *fromSocket, - NodeOperationInput *toSocket) +void COM_convert_resolution(NodeOperationBuilder &builder, + NodeOperationOutput *fromSocket, + NodeOperationInput *toSocket) { InputResizeMode mode = toSocket->getResizeMode(); diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h index fe3b8b75ccc..f110cc99c62 100644 --- a/source/blender/compositor/intern/COM_Converter.h +++ b/source/blender/compositor/intern/COM_Converter.h @@ -31,56 +31,36 @@ class NodeOperationOutput; class NodeOperationBuilder; /** - * \brief Conversion methods for the compositor + * \brief Wraps a bNode in its Node instance. + * + * For all nodetypes a wrapper class is created. + * + * \note When adding a new node to blender, this method needs to be changed to return the correct + * Node instance. + * + * \see Node */ -class Converter { - public: - /** - * \brief Convert/wraps a bNode in its Node instance. - * - * For all nodetypes a wrapper class is created. - * - * \note When adding a new node to blender, this method needs to be changed to return the correct - * Node instance. - * - * \see Node - */ - static Node *convert(bNode *b_node); - - /** - * \brief True if the node is considered 'fast'. - * - * Slow nodes will be skipped if fast execution is required. - */ - static bool is_fast_node(bNode *b_node); +Node *COM_convert_bnode(bNode *b_node); - /** - * \brief This method will add a datetype conversion rule when the to-socket does not support the - * from-socket actual data type. - * - * \note this method is called when conversion is needed. - * - * \param link: the NodeLink what needs conversion - * \param system: the ExecutionSystem to add the conversion to. - * \see NodeLink - a link between two sockets - */ - static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to); +/** + * \brief True if the node is considered 'fast'. + * + * Slow nodes will be skipped if fast execution is required. + */ +bool COM_bnode_is_fast_node(const bNode &b_node); - /** - * \brief This method will add a resolution rule based on the settings of the NodeInput. - * - * \note Conversion logic is implemented in this method - * \see InputSocketResizeMode for the possible conversions. - * - * \param link: the NodeLink what needs conversion - * \param system: the ExecutionSystem to add the conversion to. - * \see NodeLink - a link between two sockets - */ - static void convertResolution(NodeOperationBuilder &builder, - NodeOperationOutput *fromSocket, - NodeOperationInput *toSocket); +/** + * \brief This function will add a datetype conversion rule when the to-socket does not support the + * from-socket actual data type. + */ +NodeOperation *COM_convert_data_type(NodeOperationOutput *from, NodeOperationInput *to); -#ifdef WITH_CXX_GUARDEDALLOC - MEM_CXX_CLASS_ALLOC_FUNCS("COM:Converter") -#endif -}; +/** + * \brief This function will add a resolution rule based on the settings of the NodeInput. + * + * \note Conversion logic is implemented in this function. + * \see InputSocketResizeMode for the possible conversions. + */ +void COM_convert_resolution(NodeOperationBuilder &builder, + NodeOperationOutput *fromSocket, + NodeOperationInput *toSocket); diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index 44b47787b06..d03f9b86bb6 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -79,7 +79,7 @@ class ExecutionGroup; * - [@ref InputSocketResizeMode.COM_SC_NO_RESIZE]: * Bottom left of the images are aligned. * - * \see Converter.convertDataType Datatype conversions + * \see COM_convert_data_type Datatype conversions * \see Converter.convertResolution Image size conversions * * \section EM_Step4 Step4: group operations in executions groups diff --git a/source/blender/compositor/intern/COM_NodeGraph.cpp b/source/blender/compositor/intern/COM_NodeGraph.cpp index b604b8ced88..dc5ae52ba8e 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.cpp +++ b/source/blender/compositor/intern/COM_NodeGraph.cpp @@ -132,7 +132,7 @@ void NodeGraph::add_bNode(const CompositorContext &context, } /* replace slow nodes with proxies for fast execution */ - if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) { + if (context.isFastCalculation() && !COM_bnode_is_fast_node(*b_node)) { add_proxies_skip(b_ntree, b_node, key, is_active_group); return; } @@ -146,7 +146,7 @@ void NodeGraph::add_bNode(const CompositorContext &context, } else { /* regular nodes, handled in Converter */ - Node *node = Converter::convert(b_node); + Node *node = COM_convert_bnode(b_node); if (node) { add_node(node, b_ntree, key, is_active_group); } diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp index 35a3314db3b..769d1342819 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp @@ -288,7 +288,7 @@ void NodeOperationBuilder::add_datatype_conversions() } for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) { const Link &link = *it; - NodeOperation *converter = Converter::convertDataType(link.from(), link.to()); + NodeOperation *converter = COM_convert_data_type(link.from(), link.to()); if (converter) { addOperation(converter); @@ -446,7 +446,7 @@ void NodeOperationBuilder::determineResolutions() } for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) { const Link &link = *it; - Converter::convertResolution(*this, link.from(), link.to()); + COM_convert_resolution(*this, link.from(), link.to()); } } } -- cgit v1.2.3