|
Blender V5.3
|
Icon Preview | |
| PreviewLoadJob () | |
| ~PreviewLoadJob () | |
| void | push_load_request (PreviewImage *preview, eIconSizes icon_size) |
| static PreviewLoadJob & | ensure_job (wmWindowManager *wm, wmWindow *win) |
| static void | load_jobless (PreviewImage *preview, eIconSizes icon_size) |
| static void | on_download_requested (StringRef preview_full_filepath) |
| static void | on_download_completed (wmWindowManager *wm, StringRef preview_full_filepath) |
Background job to manage requests for deferred loading of previews from the hard drive.
Launches a single job to manage all incoming preview requests. The job is kept running until all preview requests are done loading (or it's otherwise aborted, e.g. by closing Blender).
Note that this will use the OS thumbnail cache, i.e. load a preview from there or add it if not there yet. These two cases may lead to different performance.
This class also supports previews that need downloading before being available for loading from disk. The download itself isn't managed by this class, but it should be informed about the download status using ED_preview_online_download_requested() and ED_preview_online_download_finished(). This only works for previews where BKE_previewimg_is_online() returns true.
Definition at line 1735 of file render_preview.cc.
| blender::PreviewLoadJob::PreviewLoadJob | ( | ) |
Definition at line 1828 of file render_preview.cc.
References blender::BLI_thread_queue_init().
Referenced by ensure_job(), load_jobless(), and on_download_completed().
| blender::PreviewLoadJob::~PreviewLoadJob | ( | ) |
Definition at line 1830 of file render_preview.cc.
References blender::BLI_thread_queue_free().
|
static |
Definition at line 1842 of file render_preview.cc.
References NC_WINDOW, PreviewLoadJob(), blender::WM_JOB_BACKGROUND, blender::WM_JOB_TYPE_LOAD_PREVIEW, blender::WM_jobs_callbacks(), blender::WM_jobs_customdata_get(), blender::WM_jobs_customdata_set(), blender::WM_jobs_get(), blender::WM_jobs_is_running(), blender::WM_jobs_start(), and blender::WM_jobs_timer().
Referenced by blender::ED_preview_icon_job().
|
static |
Definition at line 1860 of file render_preview.cc.
References PreviewLoadJob(), and push_load_request().
Referenced by blender::ED_preview_icon_render().
|
static |
Static function, can be called at any time, even before the actual preview-loading job exists.
Definition at line 1987 of file render_preview.cc.
References BLI_assert_msg, blender::BLI_thread_is_main(), lock, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), blender::NUM_ICON_SIZES, PreviewLoadJob(), blender::WM_JOB_TYPE_LOAD_PREVIEW, and blender::WM_jobs_customdata_from_type().
Referenced by blender::ED_preview_online_download_finished().
|
static |
Definition at line 2033 of file render_preview.cc.
Referenced by blender::ED_preview_online_download_requested().
| void blender::PreviewLoadJob::push_load_request | ( | PreviewImage * | preview, |
| eIconSizes | icon_size ) |
Called when the preview is requested by the UI for drawing (or something close to that).
Definition at line 1875 of file render_preview.cc.
References blender::BKE_previewimg_deferred_filepath_get(), blender::BKE_previewimg_is_online(), blender::BKE_previewimg_is_rendering(), blender::BKE_previewimg_render_end(), blender::BKE_previewimg_render_start(), blender::BLI_assert(), BLI_assert_msg, BLI_assert_unreachable, blender::BLI_thread_is_main(), blender::bke::PreviewImageRuntime::deferred_loading_data, lock, blender::PRV_RENDER_STATUS_FAILED, and blender::PreviewImage::runtime.
Referenced by blender::ED_preview_icon_job(), and load_jobless().