Realtime Compositor: Fix clang tidy warnings

Fix a number of warnings reported by Clang Tidy in the realtime
compositor's code.

Differential Revision: https://developer.blender.org/D15654

Reviewed By: Clement Foucault
This commit is contained in:
Omar Emara 2022-08-10 13:04:36 +02:00
parent 089216067f
commit 79953d5482
6 changed files with 20 additions and 13 deletions

View File

@ -146,7 +146,7 @@ class Operation {
void declare_input_descriptor(StringRef identifier, InputDescriptor descriptor);
/* Get a reference to the descriptor of the input identified by the given identified. */
InputDescriptor &get_input_descriptor(StringRef identified);
InputDescriptor &get_input_descriptor(StringRef identifier);
/* Returns a reference to the compositor context. */
Context &context();

View File

@ -35,7 +35,7 @@ class RealizeOnDomainOperation : public SimpleOperation {
static SimpleOperation *construct_if_needed(Context &context,
const Result &input_result,
const InputDescriptor &input_descriptor,
const Domain &operaiton_domain);
const Domain &operation_domain);
protected:
/* The operation domain is just the target domain. */

View File

@ -51,27 +51,32 @@ SimpleOperation *ConversionOperation::construct_if_needed(Context &context,
/* If the result type differs from the expected type, return an instance of an appropriate
* conversion operation. Otherwise, return a null pointer. */
if (result_type == ResultType::Float && expected_type == ResultType::Vector) {
return new ConvertFloatToVectorOperation(context);
}
else if (result_type == ResultType::Float && expected_type == ResultType::Color) {
if (result_type == ResultType::Float && expected_type == ResultType::Color) {
return new ConvertFloatToColorOperation(context);
}
else if (result_type == ResultType::Color && expected_type == ResultType::Float) {
if (result_type == ResultType::Color && expected_type == ResultType::Float) {
return new ConvertColorToFloatOperation(context);
}
else if (result_type == ResultType::Color && expected_type == ResultType::Vector) {
if (result_type == ResultType::Color && expected_type == ResultType::Vector) {
return new ConvertColorToVectorOperation(context);
}
else if (result_type == ResultType::Vector && expected_type == ResultType::Float) {
if (result_type == ResultType::Vector && expected_type == ResultType::Float) {
return new ConvertVectorToFloatOperation(context);
}
else if (result_type == ResultType::Vector && expected_type == ResultType::Color) {
if (result_type == ResultType::Vector && expected_type == ResultType::Color) {
return new ConvertVectorToColorOperation(context);
}
else {
return nullptr;
}
return nullptr;
}
/* -------------------------------------------------------------------------------------------------

View File

@ -67,7 +67,7 @@ bool Evaluator::validate_node_tree()
void Evaluator::compile_and_evaluate()
{
derived_node_tree_.reset(new DerivedNodeTree(node_tree_, node_tree_reference_map_));
derived_node_tree_ = std::make_unique<DerivedNodeTree>(node_tree_, node_tree_reference_map_);
if (!validate_node_tree()) {
return;

View File

@ -136,7 +136,7 @@ class Engine {
using namespace blender::draw::compositor;
typedef struct COMPOSITOR_Data {
struct COMPOSITOR_Data {
DrawEngineType *engine_type;
DRWViewportEmptyList *fbl;
DRWViewportEmptyList *txl;
@ -144,7 +144,7 @@ typedef struct COMPOSITOR_Data {
DRWViewportEmptyList *stl;
Engine *instance_data;
char info[GPU_INFO_SIZE];
} COMPOSITOR_Data;
};
static void compositor_engine_init(void *data)
{

View File

@ -7,6 +7,8 @@
#include <cmath>
#include "BLI_math_rotation.h"
#include "UI_interface.h"
#include "UI_resources.h"