From 7cd6f667e33e60f3d53e465023bb75f90f499b07 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 5 Jan 2021 13:43:32 +0100 Subject: Fix T84053: Mask overlay in image editor not working The mask overlay wasn't part of the overlay engine. The reasoning nehind this was that more editors used the mask overlay and most of them used old drawing code. This patch adds the mask overlay drawing to the draw overlay engine. This code path will only be used by the image editor VSE, Compositor and Movie Clip editor will still use the previous method. During this patch some alternatives have been researched: 1. `ED_mask_draw_region`: this would lead to different code paths when drawing in the image editor, and some hacks to retrieve the correct framebuffer. 2. Add mask drawing to image engine: Would lead to incorrect color management when viewing the mask. 3. Add mask drawing to image engine and overlay engine: Would lead to duplicated code. 4. Add mask drawing to overlay engine and for combined overlay select the correct framebuffer. Option 4 was chosen as the exception (switching framebuffers) can be done without hacks. The code stays clean. --- source/blender/draw/tests/shaders_test.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/draw/tests') diff --git a/source/blender/draw/tests/shaders_test.cc b/source/blender/draw/tests/shaders_test.cc index d365f76aabe..2c8b3d85a0a 100644 --- a/source/blender/draw/tests/shaders_test.cc +++ b/source/blender/draw/tests/shaders_test.cc @@ -241,6 +241,7 @@ TEST_F(DrawTest, overlay_glsl_shaders) EXPECT_NE(OVERLAY_shader_edit_uv_stretching_angle_get(), nullptr); EXPECT_NE(OVERLAY_shader_edit_uv_tiled_image_borders_get(), nullptr); EXPECT_NE(OVERLAY_shader_edit_uv_stencil_image(), nullptr); + EXPECT_NE(OVERLAY_shader_edit_uv_mask_image(), nullptr); EXPECT_NE(OVERLAY_shader_extra(false), nullptr); EXPECT_NE(OVERLAY_shader_extra(true), nullptr); EXPECT_NE(OVERLAY_shader_extra_groundline(), nullptr); -- cgit v1.2.3