diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 20:32:49 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 23:00:16 +0300 |
commit | 76377f0176b9561a7fc8f46b4ed704c631ddd90d (patch) | |
tree | 96775442f403dfdb0dc4d91f835495c72c1ca9c1 /source/blender/compositor/operations/COM_MathBaseOperation.cc | |
parent | 2ecd963d87e4f5215d1d86e7f1c22ab7833697f3 (diff) |
Compositor: Replace resolution concept by canvas
This is a code refactor in preparation of supporting canvas
compositing. See {D12466}.
No functional changes, all canvases are at (0,0) position matching
tiled implementation.
Differential Revision: https://developer.blender.org/D12465
Diffstat (limited to 'source/blender/compositor/operations/COM_MathBaseOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_MathBaseOperation.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cc b/source/blender/compositor/operations/COM_MathBaseOperation.cc index 2256dce011b..d3fb83caf7c 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cc +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cc @@ -51,22 +51,19 @@ void MathBaseOperation::deinitExecution() this->m_inputValue3Operation = nullptr; } -void MathBaseOperation::determineResolution(unsigned int resolution[2], - unsigned int preferredResolution[2]) +void MathBaseOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) { NodeOperationInput *socket; - unsigned int tempPreferredResolution[2] = {0, 0}; - unsigned int tempResolution[2]; - + rcti temp_area; socket = this->getInputSocket(0); - socket->determineResolution(tempResolution, tempPreferredResolution); - if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) { - this->setResolutionInputSocketIndex(0); + const bool determined = socket->determine_canvas(COM_AREA_NONE, temp_area); + if (determined) { + this->set_canvas_input_index(0); } else { - this->setResolutionInputSocketIndex(1); + this->set_canvas_input_index(1); } - NodeOperation::determineResolution(resolution, preferredResolution); + NodeOperation::determine_canvas(preferred_area, r_area); } void MathBaseOperation::clampIfNeeded(float *color) |