sequencer: don't return big values (fill pointer instead)

This commit is contained in:
Campbell Barton 2015-01-04 22:46:54 +11:00
parent 44e02651ab
commit 3447944c3f
5 changed files with 43 additions and 29 deletions

@ -102,8 +102,10 @@ typedef struct SeqRenderData {
bool is_proxy_render;
} SeqRenderData;
SeqRenderData BKE_sequencer_new_render_data(struct EvaluationContext *eval_ctx, struct Main *bmain,
struct Scene *scene, int rectx, int recty, int preview_render_size);
void BKE_sequencer_new_render_data(
struct EvaluationContext *eval_ctx, struct Main *bmain, struct Scene *scene,
int rectx, int recty, int preview_render_size,
SeqRenderData *r_context);
/* Wipe effect */
enum {

@ -515,24 +515,22 @@ void BKE_sequencer_pixel_from_sequencer_space_v4(struct Scene *scene, float pixe
/*********************** sequencer pipeline functions *************************/
SeqRenderData BKE_sequencer_new_render_data(EvaluationContext *eval_ctx,
void BKE_sequencer_new_render_data(
EvaluationContext *eval_ctx,
Main *bmain, Scene *scene, int rectx, int recty,
int preview_render_size)
int preview_render_size,
SeqRenderData *r_context)
{
SeqRenderData rval;
rval.bmain = bmain;
rval.scene = scene;
rval.rectx = rectx;
rval.recty = recty;
rval.preview_render_size = preview_render_size;
rval.motion_blur_samples = 0;
rval.motion_blur_shutter = 0;
rval.eval_ctx = eval_ctx;
rval.skip_cache = false;
rval.is_proxy_render = false;
return rval;
r_context->eval_ctx = eval_ctx;
r_context->bmain = bmain;
r_context->scene = scene;
r_context->rectx = rectx;
r_context->recty = recty;
r_context->preview_render_size = preview_render_size;
r_context->motion_blur_samples = 0;
r_context->motion_blur_shutter = 0;
r_context->skip_cache = false;
r_context->is_proxy_render = false;
}
/* ************************* iterator ************************** */
@ -1593,9 +1591,12 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, sho
/* fail safe code */
render_context = BKE_sequencer_new_render_data(bmain->eval_ctx, bmain, context->scene,
BKE_sequencer_new_render_data(
bmain->eval_ctx, bmain, context->scene,
(scene->r.size * (float) scene->r.xsch) / 100.0f + 0.5f,
(scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f, 100);
(scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f, 100,
&render_context);
render_context.skip_cache = true;
render_context.is_proxy_render = true;

@ -143,8 +143,10 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
int chanshown = sseq ? sseq->chanshown : 0;
struct bGPdata *gpd = (sseq && (sseq->flag & SEQ_SHOW_GPENCIL)) ? sseq->gpd : NULL;
context = BKE_sequencer_new_render_data(oglrender->bmain->eval_ctx, oglrender->bmain,
scene, oglrender->sizex, oglrender->sizey, 100.0f);
BKE_sequencer_new_render_data(
oglrender->bmain->eval_ctx, oglrender->bmain, scene,
oglrender->sizex, oglrender->sizey, 100.0f,
&context);
ibuf = BKE_sequencer_give_ibuf(&context, CFRA, chanshown);

@ -867,7 +867,10 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain, Scene *scene, SpaceSeq *sseq, int
rectx = (render_size * (float)scene->r.xsch) / 100.0f + 0.5f;
recty = (render_size * (float)scene->r.ysch) / 100.0f + 0.5f;
context = BKE_sequencer_new_render_data(bmain->eval_ctx, bmain, scene, rectx, recty, proxy_size);
BKE_sequencer_new_render_data(
bmain->eval_ctx, bmain, scene,
rectx, recty, proxy_size,
&context);
/* sequencer could start rendering, in this case we need to be sure it wouldn't be canceled
* by Esc pressed somewhere in the past

@ -2379,6 +2379,7 @@ static void do_render_seq(Render *re)
RenderResult *rr; /* don't assign re->result here as it might change during give_ibuf_seq */
int cfra = re->r.cfra;
SeqRenderData context;
int re_x, re_y;
re->i.cfra = cfra;
@ -2392,14 +2393,19 @@ static void do_render_seq(Render *re)
if ((re->r.mode & R_BORDER) && (re->r.mode & R_CROP) == 0) {
/* if border rendering is used and cropping is disabled, final buffer should
* be as large as the whole frame */
context = BKE_sequencer_new_render_data(re->eval_ctx, re->main, re->scene,
re->winx, re->winy, 100);
re_x = re->winx;
re_y = re->winy;
}
else {
context = BKE_sequencer_new_render_data(re->eval_ctx, re->main, re->scene,
re->result->rectx, re->result->recty, 100);
re_x = re->result->rectx;
re_y = re->result->recty;
}
BKE_sequencer_new_render_data(
re->eval_ctx, re->main, re->scene,
re_x, re_y, 100,
&context);
out = BKE_sequencer_give_ibuf(&context, cfra, 0);
if (out) {