[Bf-blender-cvs] [4b03995ce51] soc-2021-vse-strip-thumbnails: Thumbnail Cache fix : thumbs get loaded and not cleared when preview on

Aditya Y Jeppu noreply at git.blender.org
Sun Jun 20 16:31:52 CEST 2021


Commit: 4b03995ce51bcb6b7f81ccfb929dd997d30934ab
Author: Aditya Y Jeppu
Date:   Sun Jun 20 20:00:20 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rB4b03995ce51bcb6b7f81ccfb929dd997d30934ab

Thumbnail Cache fix : thumbs get loaded and not cleared when preview on

===================================================================

M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/sequencer/intern/image_cache.c
M	source/blender/sequencer/intern/render.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 61c42e228d1..09e40e92777 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1145,7 +1145,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
 
   int frame_factor = 0;
   float cut_off = 0;
-  float upper_thumb_bound = strip_x2 - handsize_clamped;
+  float upper_thumb_bound = strip_x2;
 
   while (x1 < upper_thumb_bound - 1) {
     x2 = x1 + thumb_w;
@@ -1172,6 +1172,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
     }
 
     /* clip if full thumbnail cannot be displayed */
+
     if (x2 >= (upper_thumb_bound - 1)) {
       x2 = (upper_thumb_bound - 1);
       if (x2 - x1 < 1)
@@ -1179,7 +1180,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
     }
 
     /* Get the image */
-    ibuf = SEQ_render_give_ibuf_direct(&context, x1 + cut_off, seq);
+    ibuf = SEQ_render_give_ibuf_direct(&context, x1 + (int)(cut_off), seq);
 
     if (ibuf) {
       ED_draw_imbuf_ctx_clipping(C, ibuf, x1, y1, true, x1 + cut_off, y1, x2, y2, zoom_x, zoom_y);
diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c
index ef6bec474e7..3393b034dc0 100644
--- a/source/blender/sequencer/intern/image_cache.c
+++ b/source/blender/sequencer/intern/image_cache.c
@@ -1207,7 +1207,7 @@ void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame)
     SeqCacheKey *key = BLI_ghashIterator_getKey(&gh_iter);
     BLI_ghashIterator_step(&gh_iter);
 
-    if (key->is_temp_cache && key->task_id == id) {
+    if (key->is_temp_cache && key->task_id == id && !key->context.is_thumb) {
       /* Use frame_index here to avoid freeing raw images if they are used for multiple frames. */
       float frame_index = seq_cache_timeline_frame_to_frame_index(
           key->seq, timeline_frame, key->type);
@@ -1304,7 +1304,7 @@ void seq_cache_cleanup_sequence(Scene *scene,
   int invalidate_composite = invalidate_types & SEQ_CACHE_STORE_FINAL_OUT;
   int invalidate_source = invalidate_types &
                           (SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED |
-                           SEQ_CACHE_STORE_COMPOSITE);  // TODO(AYJ) : add thumbnail
+                           SEQ_CACHE_STORE_THUMBNAIL | SEQ_CACHE_STORE_COMPOSITE);
 
   GHashIterator gh_iter;
   BLI_ghashIterator_init(&gh_iter, cache->hash);
diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c
index 4d4fcc8677e..3ae9a7a5c5b 100644
--- a/source/blender/sequencer/intern/render.c
+++ b/source/blender/sequencer/intern/render.c
@@ -541,7 +541,6 @@ static void sequencer_preprocess_transform_crop(
                                              context->preview_render_size);
   const bool do_scale_to_render_size = seq_need_scale_to_render_size(seq, is_proxy_image);
   float image_scale_factor = do_scale_to_render_size ? 1.0f : preview_scale_factor;
-  // TODO(AYJ) : check is setting image_scale_factor as const is imp
   if (context->is_thumb)
     image_scale_factor = 0.25f;



More information about the Bf-blender-cvs mailing list