Compositor: Support backdrop offset for the Viewer node

This is only part of the experimental "Full Frame" mode (disabled
by default). See T88150.

Currently the viewer node uses buffer paddings to display image offset
in the backdrop as a temporal solution implemented for {D12466}.
This solution is inefficient memory and performance-wise. Another
issue is that the paddings are part the image when saved.

This patch instead sets the offset in the Viewer node image
as variables and makes the backdrop take it into account
when drawing the image or any related gizmo.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D12750
This commit is contained in:
Habib Gahbiche
2022-03-16 23:27:52 +01:00
committed by Habib Gahbiche
parent 22de21bef1
commit 33409f9f1c
12 changed files with 92 additions and 67 deletions

View File

@@ -352,9 +352,14 @@ static void node_area_listener(const wmSpaceTypeListenerParams *params)
case ND_FRAME:
ED_area_tag_refresh(area);
break;
case ND_COMPO_RESULT:
case ND_COMPO_RESULT: {
ED_area_tag_redraw(area);
/* Backdrop image offset is calculated during compositing so gizmos need to be updated
* afterwards. */
const ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
WM_gizmomap_tag_refresh(region->gizmo_map);
break;
}
case ND_TRANSFORM_DONE:
if (ED_node_is_compositor(snode)) {
if (snode->flag & SNODE_AUTO_RENDER) {