Commit: 57de5686048f1eac07985eb2991f0b6f6c4fee22
Author: Clément Foucault
Date:   Wed Oct 14 18:18:42 2020 +0200
Branches: master
https://developer.blender.org/rB57de5686048f1eac07985eb2991f0b6f6c4fee22

Fix T81004 Python: Images drawn in the Sequence Editor have wrong colors

This was caused by the sequencer using a sRGB buffer without using
the sRGB transform.

This patch make it so that the framebuffer is rebound using the
sRGB transform before the python draw callbacks.

===================================================================

M       source/blender/editors/screen/area.c
M       source/blender/editors/space_sequencer/sequencer_draw.c

===================================================================

diff --git a/source/blender/editors/screen/area.c 
b/source/blender/editors/screen/area.c
index 6399778f62b..1a8c74c59b1 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -552,7 +552,10 @@ void ED_region_do_draw(bContext *C, ARegion *region)
    * for drawing of borders/gestures etc */
   ED_region_pixelspace(region);
 
+  GPUFrameBuffer *fb = GPU_framebuffer_active_get();
+  GPU_framebuffer_bind(fb);
   ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_PIXEL);
+  GPU_framebuffer_bind_no_srgb(fb);
 
   region_draw_azones(area, region);
 
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c 
b/source/blender/editors/space_sequencer/sequencer_draw.c
index 38b5ebaf78c..89d6d647ada 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -2299,7 +2299,10 @@ void draw_timeline_seq(const bContext *C, ARegion 
*region)
   }
 
   /* Draw attached callbacks. */
+  GPU_framebuffer_bind(framebuffer_overlay);
   ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW);
+  GPU_framebuffer_bind_no_srgb(framebuffer_overlay);
+
   seq_draw_sfra_efra(scene, v2d);
 
   if (ed) {
@@ -2353,7 +2356,10 @@ void draw_timeline_seq(const bContext *C, ARegion 
*region)
   ANIM_draw_previewrange(C, v2d, 1);
 
   /* Draw registered callbacks. */
+  GPU_framebuffer_bind(framebuffer_overlay);
   ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW);
+  GPU_framebuffer_bind_no_srgb(framebuffer_overlay);
+
   UI_view2d_view_restore(C);
   ED_time_scrub_draw(region, scene, !(sseq->flag & SEQ_DRAWFRAMES), true);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to