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-05 12:54:29 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-05 15:46:25 +0300
commita592f7e6cbd30c65360cdeb912bc29afb40a7daf (patch)
tree8bc4dd62bb8ff894441426f863923f36d8aac2af /source/blender/compositor/intern
parentb12be5a872e308ee356b1da96a7f71346618b616 (diff)
Cleanup: COM_convert_data_types parameters.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp19
-rw-r--r--source/blender/compositor/intern/COM_Converter.h3
-rw-r--r--source/blender/compositor/intern/COM_NodeOperationBuilder.cpp2
3 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index c8ac86ccd5b..7d897d29576 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -419,27 +419,28 @@ Node *COM_convert_bnode(bNode *b_node)
return node;
}
-NodeOperation *COM_convert_data_type(NodeOperationOutput *from, NodeOperationInput *to)
+/* TODO(jbakker): make this an std::optional<NodeOperation>. */
+NodeOperation *COM_convert_data_type(const NodeOperationOutput &from, const NodeOperationInput &to)
{
- DataType fromDatatype = from->getDataType();
- DataType toDatatype = to->getDataType();
+ const DataType src_data_type = from.getDataType();
+ const DataType dst_data_type = to.getDataType();
- if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
+ if (src_data_type == COM_DT_VALUE && dst_data_type == COM_DT_COLOR) {
return new ConvertValueToColorOperation();
}
- if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
+ if (src_data_type == COM_DT_VALUE && dst_data_type == COM_DT_VECTOR) {
return new ConvertValueToVectorOperation();
}
- if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
+ if (src_data_type == COM_DT_COLOR && dst_data_type == COM_DT_VALUE) {
return new ConvertColorToValueOperation();
}
- if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
+ if (src_data_type == COM_DT_COLOR && dst_data_type == COM_DT_VECTOR) {
return new ConvertColorToVectorOperation();
}
- if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
+ if (src_data_type == COM_DT_VECTOR && dst_data_type == COM_DT_VALUE) {
return new ConvertVectorToValueOperation();
}
- if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
+ if (src_data_type == COM_DT_VECTOR && dst_data_type == COM_DT_COLOR) {
return new ConvertVectorToColorOperation();
}
diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h
index f110cc99c62..59be34bf0e3 100644
--- a/source/blender/compositor/intern/COM_Converter.h
+++ b/source/blender/compositor/intern/COM_Converter.h
@@ -53,7 +53,8 @@ bool COM_bnode_is_fast_node(const bNode &b_node);
* \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);
+NodeOperation *COM_convert_data_type(const NodeOperationOutput &from,
+ const NodeOperationInput &to);
/**
* \brief This function will add a resolution rule based on the settings of the NodeInput.
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
index 769d1342819..37d8d44ec72 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 = COM_convert_data_type(link.from(), link.to());
+ NodeOperation *converter = COM_convert_data_type(*link.from(), *link.to());
if (converter) {
addOperation(converter);