diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/allocimbuf.c | 18 | ||||
-rw-r--r-- | source/blender/imbuf/intern/imageprocess.c | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/rectop.c | 4 |
4 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 9e9c47194e1..173c8135f96 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -700,6 +700,8 @@ void imb_freemipmapImBuf(struct ImBuf *ibuf); bool imb_addtilesImBuf(struct ImBuf *ibuf); void imb_freetilesImBuf(struct ImBuf *ibuf); +void imb_freerectImbuf_all(struct ImBuf *ibuf); + /* threaded processors */ void IMB_processor_apply_threaded( int buffer_lines, diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 75db3fd3c73..381de9de610 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -197,6 +197,17 @@ void IMB_freezbuffloatImBuf(ImBuf *ibuf) ibuf->mall &= ~IB_zbuffloat; } +/** Free all pixel data (assosiated with image size). */ +void imb_freerectImbuf_all(ImBuf *ibuf) +{ + imb_freerectImBuf(ibuf); + imb_freerectfloatImBuf(ibuf); + imb_freetilesImBuf(ibuf); + IMB_freezbufImBuf(ibuf); + IMB_freezbuffloatImBuf(ibuf); + freeencodedbufferImBuf(ibuf); +} + void IMB_freeImBuf(ImBuf *ibuf) { if (ibuf) { @@ -212,12 +223,7 @@ void IMB_freeImBuf(ImBuf *ibuf) BLI_spin_unlock(&refcounter_spin); if (needs_free) { - imb_freerectImBuf(ibuf); - imb_freerectfloatImBuf(ibuf); - imb_freetilesImBuf(ibuf); - IMB_freezbufImBuf(ibuf); - IMB_freezbuffloatImBuf(ibuf); - freeencodedbufferImBuf(ibuf); + imb_freerectImbuf_all(ibuf); IMB_metadata_free(ibuf->metadata); colormanage_cache_free(ibuf); diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 49e9c4c54d2..ec03a0a07b8 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -401,11 +401,6 @@ typedef struct ScanlineGlobalData { int total_scanlines; } ScanlineGlobalData; -typedef struct ScanlineTask { - int start_scanline; - int num_scanlines; -} ScanlineTask; - static void processor_apply_scanline_func(TaskPool *__restrict pool, void *taskdata, int UNUSED(threadid)) diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 3163a960892..7150e41841b 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -262,7 +262,7 @@ void IMB_rect_crop(ImBuf *ibuf, const rcti *crop) BLI_rcti_size_x(crop) + 1, BLI_rcti_size_y(crop) + 1, }; - BLI_assert(size_dst[0] > 0 && size_dst[0] > 0); + BLI_assert(size_dst[0] > 0 && size_dst[1] > 0); BLI_assert(crop->xmin >= 0 && crop->ymin >= 0); BLI_assert(crop->xmax < ibuf->x && crop->ymax < ibuf->y); @@ -304,7 +304,7 @@ static void rect_realloc_16bytes(void **buf_p, const uint size[2]) */ void IMB_rect_size_set(ImBuf *ibuf, const uint size[2]) { - BLI_assert(size[0] > 0 && size[0] > 0); + BLI_assert(size[0] > 0 && size[1] > 0); if ((size[0] == ibuf->x) && (size[1] == ibuf->y)) { return; } |