sequencer: don't return big values (fill pointer instead)
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jan 2015 11:46:54 +0000 (22:46 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jan 2015 11:46:54 +0000 (22:46 +1100)
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/render/render_opengl.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/render/intern/source/pipeline.c

index 5a0c7ac1ce188086002a0cffd9e7f769bb2b67b6..24e8d6362c15c5ec6df9853d0ac15a4e46d26c34 100644 (file)
@@ -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 {
index 1344062a958c18e53355e651b7aa084fe4938dde..b43e481d97d7341248b2234755657ac69a23cde5 100644 (file)
@@ -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,
-                                            Main *bmain, Scene *scene, int rectx, int recty,
-                                            int preview_render_size)
-{
-       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;
+void BKE_sequencer_new_render_data(
+        EvaluationContext *eval_ctx,
+        Main *bmain, Scene *scene, int rectx, int recty,
+        int preview_render_size,
+        SeqRenderData *r_context)
+{
+       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,
-                                           (scene->r.size * (float) scene->r.xsch) / 100.0f + 0.5f,
-                                           (scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f, 100);
+       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,
+               &render_context);
+
        render_context.skip_cache = true;
        render_context.is_proxy_render = true;
 
index cd56936538193c2a1db5b109c24b482d7e283ecd..8024add41cfeabd304c62d2baa48a7c1b75c7efe 100644 (file)
@@ -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);
 
index 8b58f9cd90863a66ee34bac05c0293417e5ca150..e4d9c986603df3fad5892aae17e0a6471f3fe63c 100644 (file)
@@ -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
index 1f17b82da3b29f118bcb8e1948f42b16572c9e12..87961c03ed240a7c2778e2f2a85505233f50e897 100644 (file)
@@ -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) {