Fix T39953: Float data images display trash in image editor

Was a failure of optimization trick.
This commit is contained in:
Sergey Sharybin
2014-04-30 16:26:20 +06:00
parent cdc5d6537f
commit fe29f92030

View File

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