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-06 16:48:48 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-12 20:18:08 +0300
commita0a9499a3a6bc8001c59c7b547ca7a7781415c9a (patch)
tree6e8fe7d1ae4e50dec05e1a1078444211fd1c47e1 /source/blender/compositor/operations/COM_PreviewOperation.cc
parentc946fdb2e5fc1eab139f70f01ea4e673435455bd (diff)
Compositor: Replace resolution concept by canvas
This is a code refactor in preparation of supporting canvas compositing. No functional changes, all canvases are at (0, 0) position matching tiled implementation.
Diffstat (limited to 'source/blender/compositor/operations/COM_PreviewOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cc b/source/blender/compositor/operations/COM_PreviewOperation.cc
index fa8b5ffcabf..7b1dd89bd75 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.cc
+++ b/source/blender/compositor/operations/COM_PreviewOperation.cc
@@ -130,14 +130,14 @@ bool PreviewOperation::determineDependingAreaOfInterest(rcti *input,
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
-void PreviewOperation::determineResolution(unsigned int resolution[2],
- unsigned int /*preferredResolution*/[2])
+void PreviewOperation::determine_canvas(const rcti &UNUSED(preferred_area), rcti &r_area)
{
/* Use default preview resolution as preferred ensuring it has size so that
* generated inputs (which don't have resolution on their own) are displayed */
BLI_assert(this->m_defaultWidth > 0 && this->m_defaultHeight > 0);
- unsigned int previewPreferredRes[2] = {this->m_defaultWidth, this->m_defaultHeight};
- NodeOperation::determineResolution(resolution, previewPreferredRes);
+ rcti local_preferred;
+ BLI_rcti_init(&local_preferred, 0, m_defaultWidth, 0, m_defaultHeight);
+ NodeOperation::determine_canvas(local_preferred, r_area);
/* If resolution is 0 there are two possible scenarios:
* - Either node is not connected at all
@@ -148,8 +148,8 @@ void PreviewOperation::determineResolution(unsigned int resolution[2],
* The latter case would only happen if an input doesn't set any resolution ignoring output
* preferred resolution. In such case preview size will be 0 too.
*/
- int width = resolution[0];
- int height = resolution[1];
+ int width = BLI_rcti_size_x(&r_area);
+ int height = BLI_rcti_size_y(&r_area);
this->m_divider = 0.0f;
if (width > 0 && height > 0) {
if (width > height) {
@@ -162,8 +162,7 @@ void PreviewOperation::determineResolution(unsigned int resolution[2],
width = width * this->m_divider;
height = height * this->m_divider;
- resolution[0] = width;
- resolution[1] = height;
+ BLI_rcti_init(&r_area, 0, width, 0, height);
}
eCompositorPriority PreviewOperation::getRenderPriority() const