Blender Git Loki
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
10 Modified Paths:
/source/blender/blenkernel/BKE_icons.h (+2, -0) (Diff)
/source/blender/blenkernel/intern/icons.c (+84, -41) (Diff)
/source/blender/editors/include/ED_render.h (+7, -3) (Diff)
/source/blender/editors/interface/interface.c (+22, -19) (Diff)
/source/blender/editors/interface/interface_icons.c (+57, -13) (Diff)
/source/blender/editors/interface/interface_intern.h (+3, -0) (Diff)
/source/blender/editors/interface/interface_templates.c (+6, -8) (Diff)
/source/blender/editors/render/render_preview.c (+67, -49) (Diff)
/source/blender/makesdna/DNA_ID.h (+8, -4) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+36, -20) (Diff)
/source/blender/blenkernel/intern/icons.c (+84, -41) (Diff)
/source/blender/editors/include/ED_render.h (+7, -3) (Diff)
/source/blender/editors/interface/interface.c (+22, -19) (Diff)
/source/blender/editors/interface/interface_icons.c (+57, -13) (Diff)
/source/blender/editors/interface/interface_intern.h (+3, -0) (Diff)
/source/blender/editors/interface/interface_templates.c (+6, -8) (Diff)
/source/blender/editors/render/render_preview.c (+67, -49) (Diff)
/source/blender/makesdna/DNA_ID.h (+8, -4) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+36, -20) (Diff)