Blender Git Commit Log

Git Commits -> Revision 1931cca

Revision 1931cca by Bastien Montagne (ui-preview-buttons)
May 8, 2015, 17:54 (GMT)
Deferred loading for PreviewImage and icons based on them.

This only works with thumbnails/filepath currently, but later we may extend it with
other 'generated' ways...

When requesting a PreviewImage from path thumbnail, only path (and thumb type) are stored
in over-allocated fashion at end of PreviewImage struct.

Then, calling `BKE_previewimg_ensure()` will take care of loading actual data if needed.
This is only used from RNA currently, however, since we do not want to do that from
main thread in draw icon code.

For drawing code itself, tweaked system already existing for ID previews to also
handle deferred (thumbnails) ones.

Side Note: current job-based preview generation seems really bad to me:
* It is not thread-safe - not at all! Reading **and writing** data from job thread
(IDs, preview's rect, ...), without any protection of course.
* It is badly used and adds a huge overweight (one job **per preview**!!!).
This has to be completely rewriten imho, probably in a similar way as what is done
for filebrowser previews in asset-experiments branch, i.e. using much lighter BLI_task,
and being much stricter about not sharing memory between worker and main threads,
but this is outside of scope for this patch.

Commit Details:

Full Hash: 1931cca4a60347c30efcb0a1867ec3446d4352a2
Parent Commit: 7cc96f7
Lines Changed: +292, -157

By: Miika HämäläinenLast update: Nov-07-2014 14:18 MiikaHweb | 2003-2019