Fix for [#25713] VSE shows and renders wrong straight alpha gradient even after conve...
authorJanne Karhu <jhkarh@gmail.com>
Fri, 28 Jan 2011 00:59:42 +0000 (00:59 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Fri, 28 Jan 2011 00:59:42 +0000 (00:59 +0000)
* Caching of the start and end stills were just referencing the original imbuf (which got premultiplied after the caching), so as a result most of the time the premul was applied twice.
* Now the start and end stills are stored in the cache as duplicates of the original (non modified) imbuf.

source/blender/blenkernel/intern/seqcache.c
source/blender/blenkernel/intern/sequencer.c

index 122e186bcd7272666f0dff808c4e84d5d365c085..78cd4bb51fe129a3006c213bed081883568d4e55 100644 (file)
@@ -232,8 +232,9 @@ void seq_stripelem_cache_put(
        key->cfra = cfra - seq->start;
        key->type = type;
 
-       /* we want our own version */
-       IMB_refImBuf(i);
+       /* Normally we want our own version, but start and end stills are duplicates of the original. */
+       if(ELEM(type, SEQ_STRIPELEM_IBUF_STARTSTILL, SEQ_STRIPELEM_IBUF_ENDSTILL)==0)
+               IMB_refImBuf(i);
 
        e = (seqCacheEntry*) BLI_mempool_alloc(entrypool);
 
index 9ffc04c519113ed07fd1ce1627341d3b92a78c8a..973f14d690cefc4b0bec15881f225c153ee1ce45 100644 (file)
@@ -1705,13 +1705,13 @@ static void copy_to_ibuf_still(SeqRenderData context, Sequence * seq, float nr,
        if (nr == 0) {
                seq_stripelem_cache_put(
                        context, seq, seq->start, 
-                       SEQ_STRIPELEM_IBUF_STARTSTILL, ibuf);
+                       SEQ_STRIPELEM_IBUF_STARTSTILL, IMB_dupImBuf(ibuf));
        } 
 
        if (nr == seq->len - 1) {
                seq_stripelem_cache_put(
                        context, seq, seq->start, 
-                       SEQ_STRIPELEM_IBUF_ENDSTILL, ibuf);
+                       SEQ_STRIPELEM_IBUF_ENDSTILL, IMB_dupImBuf(ibuf));
        }
 }