diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-23 02:58:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-23 02:58:25 +0300 |
commit | 1160a3a3f83cafda98e7bf6fb111bdacc5f28a63 (patch) | |
tree | b969f2508aac0cb59cd3fe81119dc1301a84bfb0 /source/blender/imbuf/intern/colormanagement.c | |
parent | d2a3b99ff7abb3d7deb30da4554b1cda6ff32766 (diff) |
Cleanup: Clang tidy
Mainly duplicate includes and else after return.
Diffstat (limited to 'source/blender/imbuf/intern/colormanagement.c')
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 33873b5daa7..a58c2ba4c44 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -2481,22 +2481,21 @@ static ImBuf *imbuf_ensure_editable(ImBuf *ibuf, ImBuf *colormanaged_ibuf, bool IMB_metadata_copy(colormanaged_ibuf, ibuf); return colormanaged_ibuf; } - else { - /* Render pipeline is constructing image buffer itself, - * but it's re-using byte and float buffers from render result make copy of this buffers - * here sine this buffers would be transformed to other color space here. */ - if (ibuf->rect && (ibuf->mall & IB_rect) == 0) { - ibuf->rect = MEM_dupallocN(ibuf->rect); - ibuf->mall |= IB_rect; - } - if (ibuf->rect_float && (ibuf->mall & IB_rectfloat) == 0) { - ibuf->rect_float = MEM_dupallocN(ibuf->rect_float); - ibuf->mall |= IB_rectfloat; - } + /* Render pipeline is constructing image buffer itself, + * but it's re-using byte and float buffers from render result make copy of this buffers + * here sine this buffers would be transformed to other color space here. */ + if (ibuf->rect && (ibuf->mall & IB_rect) == 0) { + ibuf->rect = MEM_dupallocN(ibuf->rect); + ibuf->mall |= IB_rect; + } - return ibuf; + if (ibuf->rect_float && (ibuf->mall & IB_rectfloat) == 0) { + ibuf->rect_float = MEM_dupallocN(ibuf->rect_float); + ibuf->mall |= IB_rectfloat; } + + return ibuf; } ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, |