Fix T39953: Float data images display trash in image editor
Was a failure of optimization trick.
This commit is contained in:
@@ -2779,21 +2779,27 @@ void IMB_partial_display_buffer_update(ImBuf *ibuf, const float *linear_buffer,
|
|||||||
ColormanageProcessor *cm_processor = NULL;
|
ColormanageProcessor *cm_processor = NULL;
|
||||||
bool skip_transform = false;
|
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
|
* 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);
|
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);
|
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,
|
partial_buffer_update_rect(ibuf, display_buffer, linear_buffer, byte_buffer, buffer_width, stride,
|
||||||
offset_x, offset_y, cm_processor, xmin, ymin, xmax, ymax);
|
offset_x, offset_y, cm_processor, xmin, ymin, xmax, ymax);
|
||||||
|
|
||||||
if (cm_processor)
|
if (cm_processor) {
|
||||||
IMB_colormanagement_processor_free(cm_processor);
|
IMB_colormanagement_processor_free(cm_processor);
|
||||||
|
}
|
||||||
|
|
||||||
IMB_display_buffer_release(cache_handle);
|
IMB_display_buffer_release(cache_handle);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user