Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:
[x] I've formatted my code according to Natron's code style
[x] I've searched the pull requests tracker to ensure that this PR is not a duplicate
PR Description
What type of PR is this? (Check one of the boxes below)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Improvement (non-breaking change which does not add functionality nor fixes a bug but improves Natron in some way)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] My change requires a change to the documentation
[ ] I have updated the documentation accordingly
What does this pull request do?
This change fixes 2 bugs where RectI objects containing information for different mipMapLevels were being intersected with each other. This was causing visible compositing errors in the viewer when viewing the image zoomed out, partially clipped by the edge of the viewer, and then pressing the "Forces a new render for the current frame" button. This fix just makes sure the RectIs are converted to the proper mipMapLevel before being intersected.
I also included a few cleanup changes that do not modify existing functionality but make the code a little easier to follow and verify correctness.
Updated rod computation so that rod could be declared as const. This is to make it easier to prove that this variable does not change beyond this point.
Moved initial roi computation down to the image bounds computation code since that is where it is initially used and gets updated.
Introduced isSupportedRenderScale() helper to remove duplicate code related to RenderScale support.
Show a few screenshots (if this is a visual change)
Have you tested your changes (if applicable)? If so, how?
Yes. I've verified that my change fixes the rendering issues as shown in the image above.
Futher details of this pull request
These changes likely fix rendering issues in other scenarios as well. The one mentioned above is the easily repeatable one that I discovered and used for testing.
Technically, the isSupportedRenderScale() change isn't entirely necessary, but I noticed the cleanup opportunity while updating the rod code.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:
PR Description
What type of PR is this? (Check one of the boxes below)
What does this pull request do?
This change fixes 2 bugs where RectI objects containing information for different mipMapLevels were being intersected with each other. This was causing visible compositing errors in the viewer when viewing the image zoomed out, partially clipped by the edge of the viewer, and then pressing the "Forces a new render for the current frame" button. This fix just makes sure the RectIs are converted to the proper mipMapLevel before being intersected.
I also included a few cleanup changes that do not modify existing functionality but make the code a little easier to follow and verify correctness.
Show a few screenshots (if this is a visual change)
Have you tested your changes (if applicable)? If so, how?
Yes. I've verified that my change fixes the rendering issues as shown in the image above.
Futher details of this pull request
These changes likely fix rendering issues in other scenarios as well. The one mentioned above is the easily repeatable one that I discovered and used for testing.
Technically, the isSupportedRenderScale() change isn't entirely necessary, but I noticed the cleanup opportunity while updating the rod code.