[Bf-blender-cvs] [d07dc28e0c9] soc-2021-vse-strip-thumbnails: Added changes specified in comments - D11718

Aditya Y Jeppu noreply at git.blender.org
Mon Jun 28 15:29:52 CEST 2021


Commit: d07dc28e0c9171218a6aa13505f6cf7715fb4f9c
Author: Aditya Y Jeppu
Date:   Mon Jun 28 18:59:15 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rBd07dc28e0c9171218a6aa13505f6cf7715fb4f9c

Added changes specified in comments - D11718

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

M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/makesdna/DNA_sequence_types.h
M	source/blender/sequencer/SEQ_render.h
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 03ef414d9e6..9005161c71f 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1116,7 +1116,6 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
   context.use_proxies = false;
   context.is_prefetch_render = false;
   context.is_proxy_render = false;
-  context.is_thumb = true;
 
   ibuf = SEQ_render_thumbnail(&context, seq, seq->startdisp, cache_limits, &crop, false);
   image_y = ibuf->y;
@@ -1176,7 +1175,8 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
     BLI_rcti_init(&crop, (int)(cropx_min), (int)(cropx_max)-1, 0, (int)(image_y)-1);
 
     /* Get the image */
-    ibuf = SEQ_render_thumbnail(&context, seq, x1 + (int)(cut_off), cache_limits, &crop, clipped);
+    ibuf = SEQ_render_thumbnail(
+        &context, seq, round_fl_to_int(x1 + (cut_off)), cache_limits, &crop, clipped);
 
     if (ibuf) {
       ED_draw_imbuf_ctx_clipping(
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 6e77b04f65c..21cc9116fc3 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -691,22 +691,23 @@ enum {
   SEQ_CACHE_STORE_PREPROCESSED = (1 << 1),
   SEQ_CACHE_STORE_COMPOSITE = (1 << 2),
   SEQ_CACHE_STORE_FINAL_OUT = (1 << 3),
-  SEQ_CACHE_STORE_THUMBNAIL = (1 << 4),
 
   /* For lookup purposes */
-  SEQ_CACHE_ALL_TYPES = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED |  SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT,
+  SEQ_CACHE_ALL_TYPES = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED |
+                        SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT,
 
-  SEQ_CACHE_OVERRIDE = (1 << 5),
+  SEQ_CACHE_OVERRIDE = (1 << 4),
 
   /* enable cache visualization overlay in timeline UI */
-  SEQ_CACHE_VIEW_ENABLE = (1 << 6),
-  SEQ_CACHE_VIEW_RAW = (1 << 7),
-  SEQ_CACHE_VIEW_PREPROCESSED = (1 << 8),
-  SEQ_CACHE_VIEW_COMPOSITE = (1 << 9),
-  SEQ_CACHE_VIEW_FINAL_OUT = (1 << 10),
-
-  SEQ_CACHE_PREFETCH_ENABLE = (1 << 11),
-  SEQ_CACHE_DISK_CACHE_ENABLE = (1 << 12),
+  SEQ_CACHE_VIEW_ENABLE = (1 << 5),
+  SEQ_CACHE_VIEW_RAW = (1 << 6),
+  SEQ_CACHE_VIEW_PREPROCESSED = (1 << 7),
+  SEQ_CACHE_VIEW_COMPOSITE = (1 << 8),
+  SEQ_CACHE_VIEW_FINAL_OUT = (1 << 9),
+
+  SEQ_CACHE_PREFETCH_ENABLE = (1 << 10),
+  SEQ_CACHE_DISK_CACHE_ENABLE = (1 << 11),
+  SEQ_CACHE_STORE_THUMBNAIL = (1 << 12),
 };
 
 #ifdef __cplusplus
diff --git a/source/blender/sequencer/SEQ_render.h b/source/blender/sequencer/SEQ_render.h
index 6860b2c15d2..96788a4f67c 100644
--- a/source/blender/sequencer/SEQ_render.h
+++ b/source/blender/sequencer/SEQ_render.h
@@ -51,7 +51,6 @@ typedef struct SeqRenderData {
   bool skip_cache;
   bool is_proxy_render;
   bool is_prefetch_render;
-  bool is_thumb;
   int view_id;
   /* ID of task for assigning temp cache entries to particular task(thread, etc.) */
   eSeqTaskId task_id;
diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c
index 8d0d6a28941..e230e15e721 100644
--- a/source/blender/sequencer/intern/image_cache.c
+++ b/source/blender/sequencer/intern/image_cache.c
@@ -1209,7 +1209,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 && !key->context.is_thumb) {
+    if (key->is_temp_cache && key->task_id == id && key->type != SEQ_CACHE_STORE_THUMBNAIL) {
       /* 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);
diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c
index aac5debaacc..0584da25557 100644
--- a/source/blender/sequencer/intern/render.c
+++ b/source/blender/sequencer/intern/render.c
@@ -235,7 +235,6 @@ void SEQ_render_new_render_data(Main *bmain,
   r_context->gpu_offscreen = NULL;
   r_context->task_id = SEQ_TASK_MAIN_RENDER;
   r_context->is_prefetch_render = false;
-  r_context->is_thumb = false;
 }
 
 void seq_render_state_init(SeqRenderState *state)
@@ -564,7 +563,7 @@ static void sequencer_preprocess_transform_crop(
                                          SEQ_rendersize_to_scale_factor(
                                              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;
+  const float image_scale_factor = do_scale_to_render_size ? 1.0f : preview_scale_factor;
 
   float transform_matrix[3][3];
   sequencer_image_crop_transform_matrix(
@@ -573,7 +572,7 @@ static void sequencer_preprocess_transform_crop(
   /* Proxy image is smaller, so crop values must be corrected by proxy scale factor.
    * Proxy scale factor always matches preview_scale_factor. */
   rctf source_crop;
-  float crop_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f;
+  const float crop_scale_factor = do_scale_to_render_size ? preview_scale_factor : 1.0f;
   sequencer_image_crop_init(seq, in, crop_scale_factor, &source_crop);
 
   const eIMBInterpolationFilterMode filter = context->for_render ? IMB_FILTER_BILINEAR :



More information about the Bf-blender-cvs mailing list