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:
authorManuel Castilla <manzanillawork@gmail.com>2021-09-28 20:32:49 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-28 23:00:16 +0300
commit76377f0176b9561a7fc8f46b4ed704c631ddd90d (patch)
tree96775442f403dfdb0dc4d91f835495c72c1ca9c1 /source/blender/compositor/operations/COM_MixOperation.cc
parent2ecd963d87e4f5215d1d86e7f1c22ab7833697f3 (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_MixOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_MixOperation.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/compositor/operations/COM_MixOperation.cc b/source/blender/compositor/operations/COM_MixOperation.cc
index 77ecbf60356..4b9f4786e79 100644
--- a/source/blender/compositor/operations/COM_MixOperation.cc
+++ b/source/blender/compositor/operations/COM_MixOperation.cc
@@ -66,29 +66,27 @@ void MixBaseOperation::executePixelSampled(float output[4], float x, float y, Pi
output[3] = inputColor1[3];
}
-void MixBaseOperation::determineResolution(unsigned int resolution[2],
- unsigned int preferredResolution[2])
+void MixBaseOperation::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(1);
- socket->determineResolution(tempResolution, tempPreferredResolution);
- if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
- this->setResolutionInputSocketIndex(1);
+ bool determined = socket->determine_canvas(COM_AREA_NONE, temp_area);
+ if (determined) {
+ this->set_canvas_input_index(1);
}
else {
socket = this->getInputSocket(2);
- socket->determineResolution(tempResolution, tempPreferredResolution);
- if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
- this->setResolutionInputSocketIndex(2);
+ determined = socket->determine_canvas(COM_AREA_NONE, temp_area);
+ if (determined) {
+ this->set_canvas_input_index(2);
}
else {
- this->setResolutionInputSocketIndex(0);
+ this->set_canvas_input_index(0);
}
}
- NodeOperation::determineResolution(resolution, preferredResolution);
+ NodeOperation::determine_canvas(preferred_area, r_area);
}
void MixBaseOperation::deinitExecution()