[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56340] trunk/blender/source/blender/ editors/space_sequencer/sequencer_draw.c: Some color space issues in sequencer:

Sergey Sharybin sergey.vfx at gmail.com
Sat Apr 27 17:01:18 CEST 2013


Revision: 56340
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56340
Author:   nazgul
Date:     2013-04-27 15:01:17 +0000 (Sat, 27 Apr 2013)
Log Message:
-----------
Some color space issues in sequencer:

Sequencer was always trying to do GLSL color space
conversion, not respecting user settings at all.

This failed a lot when RGB curves a used in color
management settings.

Now sequencer will fallback if GLSL can not be used
and will also respect user settings (however, draw
pixels are not supported, sequencer always uses 2D
textures).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-27 12:54:45 UTC (rev 56339)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-27 15:01:17 UTC (rev 56340)
@@ -1060,7 +1060,16 @@
 		type = GL_UNSIGNED_BYTE;
 	}
 	else {
-		if (ibuf->rect_float) {
+		bool force_fallback = false;
+
+		force_fallback |= !ELEM(U.image_draw_method, IMAGE_DRAW_METHOD_AUTO, IMAGE_DRAW_METHOD_GLSL);
+		force_fallback |= ibuf->dither != 0.0f;
+
+		if (force_fallback) {
+			/* Fallback to CPU based color space conversion */
+			glsl_used = false;
+		}
+		else if (ibuf->rect_float) {
 			display_buffer = ibuf->rect_float;
 
 			if (ibuf->channels == 4) {
@@ -1096,6 +1105,15 @@
 			type = GL_UNSIGNED_BYTE;
 			display_buffer = NULL;
 		}
+
+		/* there's a data to be displayed, but GLSL is not initialized
+		 * properly, in this case we fallback to CPU-based display transform
+		 */
+		if ((ibuf->rect || ibuf->rect_float) && !glsl_used) {
+			display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
+			format = GL_RGBA;
+			type = GL_UNSIGNED_BYTE;
+		}
 	}
 
 	glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);




More information about the Bf-blender-cvs mailing list