Bugfix #25446 (and todo item)

The icons for materials were always lagging or not updating
at all. I also found it suspicious slow... 
It appeared that the icons now store a "mip level", where for
every change in Materials 2 render jobs for icons were started,
one for 32x32 pix, one for 96x96. The latter was cancelling out
the first job almost always.

Also made preview renders detect size, to set amount of tiles
to be rendered. Small icons use 1 part, larger previews 16 now.

All in all, behaves much smoother now! But, will also update
the thread Jobs manager to allow "delayed jobs" like for icons,
these are aggressively put as first in the jobs list.
This commit is contained in:
2011-01-02 19:46:32 +00:00
parent 5d6c76c6a3
commit 05cfe50436
4 changed files with 30 additions and 16 deletions

View File

@@ -85,7 +85,8 @@ void free_material(Material *ma)
BKE_free_animdata((ID *)ma);
BKE_previewimg_free(&ma->preview);
if(ma->preview)
BKE_previewimg_free(&ma->preview);
BKE_icon_delete((struct ID*)ma);
ma->id.icon_id = 0;
@@ -250,7 +251,7 @@ Material *localize_material(Material *ma)
if(ma->ramp_col) man->ramp_col= MEM_dupallocN(ma->ramp_col);
if(ma->ramp_spec) man->ramp_spec= MEM_dupallocN(ma->ramp_spec);
if (ma->preview) man->preview = BKE_previewimg_copy(ma->preview);
man->preview = NULL;
if(ma->nodetree) {
man->nodetree= ntreeLocalize(ma->nodetree);