[Bf-blender-cvs] [fe29f92] master: Fix T39953: Float data images display trash in image editor

Sergey Sharybin noreply at git.blender.org
Wed Apr 30 12:27:02 CEST 2014


Commit: fe29f92030fe803f625efaab0842a4d79a8de428
Author: Sergey Sharybin
Date:   Wed Apr 30 16:26:20 2014 +0600
https://developer.blender.org/rBfe29f92030fe803f625efaab0842a4d79a8de428

Fix T39953:  Float data images display trash in image editor

Was a failure of optimization trick.

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

M	source/blender/imbuf/intern/colormanagement.c

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

diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 50c44c2..7731de3 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -2779,21 +2779,27 @@ void IMB_partial_display_buffer_update(ImBuf *ibuf, const float *linear_buffer,
 		ColormanageProcessor *cm_processor = NULL;
 		bool skip_transform = false;
 
-		/* byte buffer is assumed to be in imbuf's rect space, so if byte buffer
+		/* Byte buffer is assumed to be in imbuf's rect space, so if byte buffer
 		 * is known we could skip display->linear->display conversion in case
-		 * display color space matches imbuf's rect space
+		 * display color space matches imbuf's rect space.
+		 *
+		 * But if there's a float buffer it's likely operation was performed on
+		 * it first and byte buffer is likely to be out of date here.
 		 */
-		if (byte_buffer != NULL)
+		if (linear_buffer == NULL && byte_buffer != NULL) {
 			skip_transform = is_ibuf_rect_in_display_space(ibuf, view_settings, display_settings);
+		}
 
-		if (!skip_transform)
+		if (!skip_transform) {
 			cm_processor = IMB_colormanagement_display_processor_new(view_settings, display_settings);
+		}
 
 		partial_buffer_update_rect(ibuf, display_buffer, linear_buffer, byte_buffer, buffer_width, stride,
 		                           offset_x, offset_y, cm_processor, xmin, ymin, xmax, ymax);
 
-		if (cm_processor)
+		if (cm_processor) {
 			IMB_colormanagement_processor_free(cm_processor);
+		}
 
 		IMB_display_buffer_release(cache_handle);
 	}




More information about the Bf-blender-cvs mailing list