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-08-23 16:30:01 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-08-23 17:36:09 +0300
commit064167fce70e3d7c382c374334a1bd0b520fe9fe (patch)
tree6e6f9a26d8e446a9e6966fa185e9527d720b19ee /source/blender/compositor/nodes/COM_RotateNode.cc
parenta95e56b741709f7157a44196091ccad3ec369e5e (diff)
Compositor: Full frame transform nodes
Adds full frame implementation to "Rotate", "Transform" and "Stabilize2D" nodes. To avoid sampling twice when concatenating scale and rotate operations, a `TransformOperation` is implemented with all the functionality. The nodes have no functional changes. Part of T88150. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D12165
Diffstat (limited to 'source/blender/compositor/nodes/COM_RotateNode.cc')
-rw-r--r--source/blender/compositor/nodes/COM_RotateNode.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/compositor/nodes/COM_RotateNode.cc b/source/blender/compositor/nodes/COM_RotateNode.cc
index af5baa733dc..c2fd8ed5594 100644
--- a/source/blender/compositor/nodes/COM_RotateNode.cc
+++ b/source/blender/compositor/nodes/COM_RotateNode.cc
@@ -30,20 +30,31 @@ RotateNode::RotateNode(bNode *editorNode) : Node(editorNode)
}
void RotateNode::convertToOperations(NodeConverter &converter,
- const CompositorContext & /*context*/) const
+ const CompositorContext &context) const
{
NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputDegreeSocket = this->getInputSocket(1);
NodeOutput *outputSocket = this->getOutputSocket(0);
RotateOperation *operation = new RotateOperation();
- SetSamplerOperation *sampler = new SetSamplerOperation();
- sampler->setSampler((PixelSampler)this->getbNode()->custom1);
-
- converter.addOperation(sampler);
converter.addOperation(operation);
- converter.addLink(sampler->getOutputSocket(), operation->getInputSocket(0));
- converter.mapInputSocket(inputSocket, sampler->getInputSocket(0));
+ PixelSampler sampler = (PixelSampler)this->getbNode()->custom1;
+ switch (context.get_execution_model()) {
+ case eExecutionModel::Tiled: {
+ SetSamplerOperation *sampler_op = new SetSamplerOperation();
+ sampler_op->setSampler(sampler);
+ converter.addOperation(sampler_op);
+ converter.addLink(sampler_op->getOutputSocket(), operation->getInputSocket(0));
+ converter.mapInputSocket(inputSocket, sampler_op->getInputSocket(0));
+ break;
+ }
+ case eExecutionModel::FullFrame: {
+ operation->set_sampler(sampler);
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
+ break;
+ }
+ }
+
converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1));
converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
}