Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_file/filelist.c
| Show First 20 Lines • Show All 1,258 Lines • ▼ Show 20 Lines | for (entry = filelist_intern->entries.first; entry; entry = entry_next) { | ||||
| entry_next = entry->next; | entry_next = entry->next; | ||||
| filelist_intern_entry_free(entry); | filelist_intern_entry_free(entry); | ||||
| } | } | ||||
| BLI_listbase_clear(&filelist_intern->entries); | BLI_listbase_clear(&filelist_intern->entries); | ||||
| MEM_SAFE_FREE(filelist_intern->filtered); | MEM_SAFE_FREE(filelist_intern->filtered); | ||||
| } | } | ||||
| static void filelist_cache_preview_runf(TaskPool *__restrict pool, | static void filelist_cache_preview_runf(TaskPool *__restrict pool, void *taskdata) | ||||
| void *taskdata, | |||||
| int UNUSED(threadid)) | |||||
| { | { | ||||
| FileListEntryCache *cache = BLI_task_pool_user_data(pool); | FileListEntryCache *cache = BLI_task_pool_user_data(pool); | ||||
| FileListEntryPreviewTaskData *preview_taskdata = taskdata; | FileListEntryPreviewTaskData *preview_taskdata = taskdata; | ||||
| FileListEntryPreview *preview = preview_taskdata->preview; | FileListEntryPreview *preview = preview_taskdata->preview; | ||||
| ThumbSource source = 0; | ThumbSource source = 0; | ||||
| // printf("%s: Start (%d)...\n", __func__, threadid); | // printf("%s: Start (%d)...\n", __func__, threadid); | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (preview != NULL) { | ||||
| MEM_freeN(preview); | MEM_freeN(preview); | ||||
| } | } | ||||
| MEM_freeN(preview_taskdata); | MEM_freeN(preview_taskdata); | ||||
| } | } | ||||
| static void filelist_cache_preview_ensure_running(FileListEntryCache *cache) | static void filelist_cache_preview_ensure_running(FileListEntryCache *cache) | ||||
| { | { | ||||
| if (!cache->previews_pool) { | if (!cache->previews_pool) { | ||||
| TaskScheduler *scheduler = BLI_task_scheduler_get(); | cache->previews_pool = BLI_task_pool_create_background(cache, TASK_PRIORITY_LOW); | ||||
| cache->previews_pool = BLI_task_pool_create_background(scheduler, cache, TASK_PRIORITY_LOW); | |||||
| cache->previews_done = BLI_thread_queue_init(); | cache->previews_done = BLI_thread_queue_init(); | ||||
| IMB_thumb_locks_acquire(); | IMB_thumb_locks_acquire(); | ||||
| } | } | ||||
| } | } | ||||
| static void filelist_cache_previews_clear(FileListEntryCache *cache) | static void filelist_cache_previews_clear(FileListEntryCache *cache) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 1,757 Lines • Show Last 20 Lines | |||||