[Bf-blender-cvs] [0710ec485e4] master: Cleanup: Remove unused IMB tile cache code (part 2)
Jesse Yurkovich
noreply at git.blender.org
Thu Nov 24 21:53:38 CET 2022
Commit: 0710ec485e4075bee9b1d1f70bed38c6ecb189f3
Author: Jesse Yurkovich
Date: Thu Nov 24 12:40:18 2022 -0800
Branches: master
https://developer.blender.org/rB0710ec485e4075bee9b1d1f70bed38c6ecb189f3
Cleanup: Remove unused IMB tile cache code (part 2)
Missed in the first commit[1].
Initially it was reported that the `flags` parameter was unused on
`imb_cache_filename` but it turns out another swath of code was unused
related to that same function. Clean this up now too.
[1] 38573d515e49f3e0b22b0e58c7b0357bae107a4d
===================================================================
M source/blender/imbuf/IMB_imbuf_types.h
M source/blender/imbuf/intern/readimage.c
===================================================================
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index 0851aaa8669..06f7770d267 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -233,8 +233,6 @@ typedef struct ImBuf {
ImbFormatOptions foptions;
/** filename associated with this image */
char name[IMB_FILENAME_SIZE];
- /** full filename used for reading from cache */
- char cachename[IMB_FILENAME_SIZE];
/* memory cache limiter */
/** handle for cache limiter */
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 36714fa90a2..c9b6a6f6f56 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -186,34 +186,22 @@ ImBuf *IMB_loadifffile(
return ibuf;
}
-static void imb_cache_filename(char *filepath, const char *name, int flags)
-{
- BLI_strncpy(filepath, name, IMB_FILENAME_SIZE);
-}
-
ImBuf *IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
{
ImBuf *ibuf;
int file;
- char filepath_tx[IMB_FILENAME_SIZE];
BLI_assert(!BLI_path_is_rel(filepath));
- imb_cache_filename(filepath_tx, filepath, flags);
-
- file = BLI_open(filepath_tx, O_BINARY | O_RDONLY, 0);
+ file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
if (file == -1) {
return NULL;
}
- ibuf = IMB_loadifffile(file, filepath, flags, colorspace, filepath_tx);
+ ibuf = IMB_loadifffile(file, filepath, flags, colorspace, filepath);
if (ibuf) {
BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
- BLI_strncpy(ibuf->cachename, filepath_tx, sizeof(ibuf->cachename));
- for (int a = 1; a < ibuf->miptot; a++) {
- BLI_strncpy(ibuf->mipmap[a - 1]->cachename, filepath_tx, sizeof(ibuf->cachename));
- }
}
close(file);
@@ -280,23 +268,19 @@ ImBuf *IMB_testiffname(const char *filepath, int flags)
{
ImBuf *ibuf;
int file;
- char filepath_tx[IMB_FILENAME_SIZE];
char colorspace[IM_MAX_SPACE] = "\0";
BLI_assert(!BLI_path_is_rel(filepath));
- imb_cache_filename(filepath_tx, filepath, flags);
-
- file = BLI_open(filepath_tx, O_BINARY | O_RDONLY, 0);
+ file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
if (file == -1) {
return NULL;
}
- ibuf = IMB_loadifffile(file, filepath, flags | IB_test | IB_multilayer, colorspace, filepath_tx);
+ ibuf = IMB_loadifffile(file, filepath, flags | IB_test | IB_multilayer, colorspace, filepath);
if (ibuf) {
BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name));
- BLI_strncpy(ibuf->cachename, filepath_tx, sizeof(ibuf->cachename));
}
close(file);
More information about the Bf-blender-cvs
mailing list