Dont draw blocks what are outside the the view. - massive speedup with complex sequence's
authorCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jan 2006 05:14:03 +0000 (05:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 25 Jan 2006 05:14:03 +0000 (05:14 +0000)
source/blender/src/drawseq.c

index c215a256b4e4355afca6f047f8b9568ab93b8f14..8a6e80d5f012436af09170f10e3673b8cb842ef7 100644 (file)
@@ -823,7 +823,15 @@ void drawseqspace(ScrArea *sa, void *spacedata)
        if(ed) {
                seq= ed->seqbasep->first;
                while(seq) {
        if(ed) {
                seq= ed->seqbasep->first;
                while(seq) {
-                       if(seq->flag & SELECT); else drawseq(seq);
+                       if (seq->flag & SELECT ||
+                                       seq->start > G.v2d->cur.xmax ||
+                                       seq->start+seq->len < G.v2d->cur.xmin ||
+                                       seq->machine+1.0 < G.v2d->cur.ymin || seq->machine > G.v2d->cur.ymax)
+                       {
+                               /* do nothing */
+                       } else {
+                               drawseq(seq);
+                       }
                        seq= seq->next;
                }
        }
                        seq= seq->next;
                }
        }
@@ -831,7 +839,16 @@ void drawseqspace(ScrArea *sa, void *spacedata)
        if(ed) {
                seq= ed->seqbasep->first;
                while(seq) {
        if(ed) {
                seq= ed->seqbasep->first;
                while(seq) {
-                       if(seq->flag & SELECT) drawseq(seq);
+                       if (!(seq->flag & SELECT) ||
+                                       seq->start > G.v2d->cur.xmax ||
+                                       seq->start+seq->len < G.v2d->cur.xmin ||
+                                       seq->machine+1.0 < G.v2d->cur.ymin ||
+                                       seq->machine > G.v2d->cur.ymax)
+                       {
+                               /* do nothing */
+                       } else {
+                               drawseq(seq);
+                       }
                        seq= seq->next;
                }
        }
                        seq= seq->next;
                }
        }