diff options
author | Peter Schlaile <peter@schlaile.de> | 2010-07-23 20:57:11 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2010-07-23 20:57:11 +0400 |
commit | 65fcb0edcf64b70ff79e298ffebcbbf8812e2774 (patch) | |
tree | 5fc7e2fd2457d2870311e482c4190e1da4472511 /source/blender/editors/space_sequencer/sequencer_draw.c | |
parent | bf5f5bd3bd1bcd0678518e84ef778af30e940264 (diff) |
== Sequencer ==
This patch cleans up the sequencer core by replacing the caching system
(TStripElems) with a hash based system, which is:
a) a lot faster
b) a lot more readable
c) a lot more memory conserving
The new caching system is also a good building ground for
a) sub frame precision rendering (even on scene strips)
b) multi core rendering (threaded rendering is still disabled, but can
be extended now to arbitrary core numbers)
I tested the code on an extensive editing session today and had no
crashes during 4 hours of editing. So I consider it very stable.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 0d49f853a82..11881ab50d2 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -696,11 +696,11 @@ void set_special_seq_update(int val) void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs) { extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); - struct ImBuf *ibuf; + struct ImBuf *ibuf = 0; + struct ImBuf *scope = 0; struct View2D *v2d = &ar->v2d; int rectx, recty; float viewrectx, viewrecty; - int free_ibuf = 0; static int recursive= 0; float render_size = 0.0; float proxy_size = 100.0; @@ -778,28 +778,29 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq switch(sseq->mainb) { case SEQ_DRAW_IMG_IMBUF: if (sseq->zebra != 0) { - ibuf = make_zebra_view_from_ibuf(ibuf, sseq->zebra); - free_ibuf = 1; + scope = make_zebra_view_from_ibuf(ibuf, sseq->zebra); } break; case SEQ_DRAW_IMG_WAVEFORM: if ((sseq->flag & SEQ_DRAW_COLOR_SEPERATED) != 0) { - ibuf = make_sep_waveform_view_from_ibuf(ibuf); + scope = make_sep_waveform_view_from_ibuf(ibuf); } else { - ibuf = make_waveform_view_from_ibuf(ibuf); + scope = make_waveform_view_from_ibuf(ibuf); } - free_ibuf = 1; break; case SEQ_DRAW_IMG_VECTORSCOPE: - ibuf = make_vectorscope_view_from_ibuf(ibuf); - free_ibuf = 1; + scope = make_vectorscope_view_from_ibuf(ibuf); break; case SEQ_DRAW_IMG_HISTOGRAM: - ibuf = make_histogram_view_from_ibuf(ibuf); - free_ibuf = 1; + scope = make_histogram_view_from_ibuf(ibuf); break; } + if (scope) { + IMB_freeImBuf(ibuf); + ibuf = scope; + } + if(ibuf->rect_float && ibuf->rect==NULL) { IMB_rect_from_float(ibuf); } @@ -889,9 +890,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq // if (sseq->flag & SEQ_DRAW_GPENCIL) // XXX draw_gpencil_2dimage(sa, ibuf); - if (free_ibuf) { - IMB_freeImBuf(ibuf); - } + IMB_freeImBuf(ibuf); /* draw grease-pencil (screen aligned) */ // if (sseq->flag & SEQ_DRAW_GPENCIL) |