Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-04-30 14:26:20 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-04-30 14:26:20 +0400
commitfe29f92030fe803f625efaab0842a4d79a8de428 (patch)
treed7f2731cb0992d1de5d1a58ce10738a477c66663 /source/blender/imbuf/intern/colormanagement.c
parentcdc5d6537f09bceccbfaa0273bfc72696960c305 (diff)
Fix T39953: Float data images display trash in image editor
Was a failure of optimization trick.
Diffstat (limited to 'source/blender/imbuf/intern/colormanagement.c')
-rw-r--r--source/blender/imbuf/intern/colormanagement.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 50c44c2cca4..7731de33be2 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);
}