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:
authorGermano Cavalcante <mano-wii>2021-11-16 15:29:09 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-11-16 20:10:24 +0300
commit9d7422b817d143b4c50c00c7d5b860a9e414c517 (patch)
treed8b047a1eae8bd9045294f236f630426ea8545ad /source/blender/makesdna/DNA_space_types.h
parent917218269e4d8b4cf581a637cee0ece2675c9d92 (diff)
File Browser: Improve usage of threads in the creation of thumbnails
Due to asynchronous process, the preview for a given image may be generated several times. This regenerates many thumbs unnecessarily. The solution is to add the `FILE_ENTRY_PREVIEW_LOADING` flag for file entries that are still in the thread queue. So this flag is checked not to redraw the thumb when it is still being created on a different thread. Differential Revision: https://developer.blender.org/D11150
Diffstat (limited to 'source/blender/makesdna/DNA_space_types.h')
-rw-r--r--source/blender/makesdna/DNA_space_types.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 3bd7df0043a..7fb15fc8508 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1158,8 +1158,12 @@ typedef struct FileDirEntryArr {
/* FileDirEntry.flags */
enum {
- FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */
+ /* The preview for this entry could not be generated. */
+ FILE_ENTRY_INVALID_PREVIEW = 1 << 0,
+ /* The entry name needs to be freed when clearing file list. */
FILE_ENTRY_NAME_FREE = 1 << 1,
+ /* The preview for this entry is being loaded on another thread. */
+ FILE_ENTRY_PREVIEW_LOADING = 1 << 2,
};
/** \} */