Report noted the slow icon renders for menus, which indeed is an issue,
especially when texture images need to be loaded (not to mention that
will eat up loads of memory).

Added a flag in scene to disable loading of images, makes it 50 times
faster, at least :)
This commit is contained in:
Ton Roosendaal 2006-07-02 18:26:20 +00:00
parent 6adf0e6543
commit bb9cafc257
3 changed files with 7 additions and 1 deletions

@ -457,7 +457,7 @@ typedef struct Scene {
#define R_SINGLE_LAYER 0x0200 #define R_SINGLE_LAYER 0x0200
#define R_EXR_TILE_FILE 0x0400 #define R_EXR_TILE_FILE 0x0400
#define R_COMP_FREE 0x0800 #define R_COMP_FREE 0x0800
#define R_NO_IMAGE_LOAD 0x1000
/* alphamode */ /* alphamode */
#define R_ADDSKY 0 #define R_ADDSKY 0

@ -102,6 +102,9 @@ int imagewrap(Tex *tex, Image *ima, float *texvec, TexResult *texres)
} }
if(ima->ibuf==NULL) { if(ima->ibuf==NULL) {
/* hack for icon render */
if(R.r.scemode &R_NO_IMAGE_LOAD)
return 0;
BLI_lock_thread(LOCK_MALLOC); BLI_lock_thread(LOCK_MALLOC);
if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, ima); if(ima->ibuf==NULL) ima_ibuf_is_nul(tex, ima);
BLI_unlock_thread(LOCK_MALLOC); BLI_unlock_thread(LOCK_MALLOC);

@ -438,13 +438,16 @@ void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *are
sce->r.scemode |= R_NODE_PREVIEW; sce->r.scemode |= R_NODE_PREVIEW;
if(sbuts->flag & SB_PRV_OSA) if(sbuts->flag & SB_PRV_OSA)
sce->r.mode |= R_OSA; sce->r.mode |= R_OSA;
sce->r.scemode &= ~R_NO_IMAGE_LOAD;
} }
else if(pr_method==PR_DO_RENDER) { else if(pr_method==PR_DO_RENDER) {
RE_test_break_cb(re, qtest); RE_test_break_cb(re, qtest);
sce->r.scemode |= R_NODE_PREVIEW; sce->r.scemode |= R_NODE_PREVIEW;
sce->r.scemode &= ~R_NO_IMAGE_LOAD;
} }
else { /* PR_ICON_RENDER */ else { /* PR_ICON_RENDER */
sce->r.scemode &= ~R_NODE_PREVIEW; sce->r.scemode &= ~R_NODE_PREVIEW;
sce->r.scemode |= R_NO_IMAGE_LOAD;
} }
/* allocates render result */ /* allocates render result */