Fix T43681: VSE draw glitch with no-display
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Feb 2015 01:57:29 +0000 (12:57 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Feb 2015 02:05:59 +0000 (13:05 +1100)
Missed clearning the backdrop

source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesdna/DNA_space_types.h

index 3be6cd795040e9e76ce12ad22114fdca75d848af..93eb5a1db3dfd92dd0aafbb1c96f0dedda852f07 100644 (file)
@@ -960,8 +960,8 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
        struct View2D *v2d = &ar->v2d;
        /* int rectx, recty; */ /* UNUSED */
        float viewrectx, viewrecty;
-       float render_size = 0.0;
-       float proxy_size = 100.0;
+       float render_size;
+       float proxy_size;
        float col[3];
        GLuint texid;
        GLuint last_texid;
@@ -985,16 +985,37 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
                }
        }
 
-       render_size = sseq->render_size;
-       if (render_size == 0) {
+       if ((!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) && !draw_backdrop) {
+               UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
+               glClearColor(col[0], col[1], col[2], 0.0);
+               glClear(GL_COLOR_BUFFER_BIT);
+       }
+
+       /* only initialize the preview if a render is in progress */
+       if (G.is_rendering)
+               return;
+
+       if (sseq->render_size == SEQ_PROXY_RENDER_SIZE_NONE) {
+               return;
+       }
+
+       ibuf = sequencer_ibuf_get(bmain, scene, sseq, cfra, frame_ofs);
+       
+       if (ibuf == NULL)
+               return;
+
+       if (ibuf->rect == NULL && ibuf->rect_float == NULL)
+               return;
+
+
+       if (sseq->render_size == SEQ_PROXY_RENDER_SIZE_SCENE) {
                render_size = scene->r.size;
+               proxy_size = 100.0f;
        }
        else {
+               render_size = sseq->render_size;
                proxy_size = render_size;
        }
-       if (render_size < 0) {
-               return;
-       }
 
        viewrectx = (render_size * (float)scene->r.xsch) / 100.0f;
        viewrecty = (render_size * (float)scene->r.ysch) / 100.0f;
@@ -1008,23 +1029,6 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
                viewrecty /= proxy_size / 100.0f;
        }
 
-       if ((!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) && !draw_backdrop) {
-               UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
-               glClearColor(col[0], col[1], col[2], 0.0);
-               glClear(GL_COLOR_BUFFER_BIT);
-       }
-
-       /* only initialize the preview if a render is in progress */
-       if (G.is_rendering)
-               return;
-
-       ibuf = sequencer_ibuf_get(bmain, scene, sseq, cfra, frame_ofs);
-       
-       if (ibuf == NULL)
-               return;
-
-       if (ibuf->rect == NULL && ibuf->rect_float == NULL)
-               return;
 
        if (sseq->mainb != SEQ_DRAW_IMG_IMBUF || sseq->zebra != 0) {
                SequencerScopes *scopes = &sseq->scopes;
index 41fbb26c50cfc3ce4715a5e0ce5c2f2df929f098..9a495fbb43f8dcef1748b8c939021450a9bbedb9 100644 (file)
@@ -494,7 +494,7 @@ typedef struct SpaceSeq {
        
        float xof DNA_DEPRECATED, yof DNA_DEPRECATED;   /* deprecated: offset for drawing the image preview */
        short mainb;    /* weird name for the sequencer subtype (seq, image, luma... etc) */
-       short render_size;
+       short render_size;  /* eSpaceSeq_Proxy_RenderSize */
        short chanshown;
        short zebra;
        int flag;