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.
This commit is contained in:
Clément Foucault 2020-10-14 18:18:42 +02:00
parent 3271074120
commit 57de568604
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by commit 36e8561298, Fix T81969 VSE: Wrong UI colorspace after scene strip update
Referenced by issue #81004, Images drawn with Python gpu module show darker in the Sequence Editor
2 changed files with 9 additions and 0 deletions

View File

@ -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);

View File

@ -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);