Cleanup: preview rendering, push bContext a bit further down the call stack
Pass `bContext *C` a bit further down the call stack, to prevent exploding the number of parameters of `ED_preview_icon_render()`. An upcoming change will require access to yet another context member, and this can now be done without adding yet another parameter. No functional changes.
This commit is contained in:
@@ -91,8 +91,7 @@ void ED_preview_shader_job(const struct bContext *C,
|
||||
int sizex,
|
||||
int sizey,
|
||||
int method);
|
||||
void ED_preview_icon_render(struct Main *bmain,
|
||||
struct Depsgraph *depsgraph,
|
||||
void ED_preview_icon_render(const struct bContext *C,
|
||||
struct Scene *scene,
|
||||
struct ID *id,
|
||||
unsigned int *rect,
|
||||
|
||||
@@ -1428,13 +1428,7 @@ static void icon_set_image(const bContext *C,
|
||||
scene = CTX_data_scene(C);
|
||||
}
|
||||
/* Immediate version */
|
||||
ED_preview_icon_render(CTX_data_main(C),
|
||||
CTX_data_ensure_evaluated_depsgraph(C),
|
||||
scene,
|
||||
id,
|
||||
prv_img->rect[size],
|
||||
prv_img->w[size],
|
||||
prv_img->h[size]);
|
||||
ED_preview_icon_render(C, scene, id, prv_img->rect[size], prv_img->w[size], prv_img->h[size]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1608,7 +1608,7 @@ static void icon_preview_free(void *customdata)
|
||||
}
|
||||
|
||||
void ED_preview_icon_render(
|
||||
Main *bmain, Depsgraph *depsgraph, Scene *scene, ID *id, uint *rect, int sizex, int sizey)
|
||||
const bContext *C, Scene *scene, ID *id, uint *rect, int sizex, int sizey)
|
||||
{
|
||||
IconPreview ip = {NULL};
|
||||
short stop = false, update = false;
|
||||
@@ -1616,9 +1616,9 @@ void ED_preview_icon_render(
|
||||
|
||||
ED_preview_ensure_dbase();
|
||||
|
||||
ip.bmain = bmain;
|
||||
ip.bmain = CTX_data_main(C);
|
||||
ip.scene = scene;
|
||||
ip.depsgraph = depsgraph;
|
||||
ip.depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
ip.owner = BKE_previewimg_id_ensure(id);
|
||||
ip.id = id;
|
||||
/* Control isn't given back to the caller until the preview is done. So we don't need to copy
|
||||
|
||||
Reference in New Issue
Block a user