diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-04-22 09:25:40 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-04-22 09:25:40 +0300 |
commit | a4bd0fcabff72127ea6f897c11c261579dbf5ad8 (patch) | |
tree | 224387a3d9dba3488aa24aa455955707e1b94a24 | |
parent | 48c5129d1fcdaf53a281bf0359af85bd0185f038 (diff) | |
parent | a43d644decb27a0cf00da92afee71439f6d60d53 (diff) |
Merge branch 'blender-v2.93-release'
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 38 | ||||
-rw-r--r-- | source/blender/sequencer/intern/render.c | 3 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_relations.c | 1 |
3 files changed, 15 insertions, 27 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index f83ee409187..b7c226ada1d 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -41,6 +41,7 @@ #include "BLI_listbase.h" #include "BLI_math.h" +#include "BLI_math_color_blend.h" #include "BLI_rect.h" #include "BLI_string.h" #include "BLI_string_utf8.h" @@ -640,18 +641,12 @@ static void blf_font_draw_buffer_ex(FontBLF *font, (size_t)buf_info->ch); float *fbuf = buf_info->fbuf + buf_ofs; - if (a >= 1.0f) { - fbuf[0] = b_col_float[0]; - fbuf[1] = b_col_float[1]; - fbuf[2] = b_col_float[2]; - fbuf[3] = 1.0f; - } - else { - fbuf[0] = (b_col_float[0] * a) + (fbuf[0] * (1.0f - a)); - fbuf[1] = (b_col_float[1] * a) + (fbuf[1] * (1.0f - a)); - fbuf[2] = (b_col_float[2] * a) + (fbuf[2] * (1.0f - a)); - fbuf[3] = MIN2(fbuf[3] + a, 1.0f); /* clamp to 1.0 */ - } + float font_pixel[4]; + font_pixel[0] = b_col_float[0] * a; + font_pixel[1] = b_col_float[1] * a; + font_pixel[2] = b_col_float[2] * a; + font_pixel[3] = a; + blend_color_mix_float(fbuf, fbuf, font_pixel); } } @@ -677,19 +672,12 @@ static void blf_font_draw_buffer_ex(FontBLF *font, (size_t)buf_info->ch); unsigned char *cbuf = buf_info->cbuf + buf_ofs; - if (a >= 1.0f) { - cbuf[0] = b_col_char[0]; - cbuf[1] = b_col_char[1]; - cbuf[2] = b_col_char[2]; - cbuf[3] = 255; - } - else { - cbuf[0] = (unsigned char)((b_col_char[0] * a) + (cbuf[0] * (1.0f - a))); - cbuf[1] = (unsigned char)((b_col_char[1] * a) + (cbuf[1] * (1.0f - a))); - cbuf[2] = (unsigned char)((b_col_char[2] * a) + (cbuf[2] * (1.0f - a))); - /* clamp to 255 */ - cbuf[3] = (unsigned char)MIN2((int)cbuf[3] + (int)(a * 255), 255); - } + uchar font_pixel[4]; + font_pixel[0] = b_col_char[0]; + font_pixel[1] = b_col_char[1]; + font_pixel[2] = b_col_char[2]; + font_pixel[3] = unit_float_to_uchar_clamp(a); + blend_color_mix_byte(cbuf, cbuf, font_pixel); } } diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index 572fff0ad38..96c881c9c5f 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -1537,13 +1537,14 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, /* opengl offscreen render */ depsgraph = BKE_scene_ensure_depsgraph(context->bmain, scene, view_layer); BKE_scene_graph_update_for_newframe(depsgraph); + Object *camera_eval = DEG_get_evaluated_object(depsgraph, camera); ibuf = sequencer_view3d_fn( /* set for OpenGL render (NULL when scrubbing) */ depsgraph, scene, &context->scene->display.shading, context->scene->r.seq_prev_type, - camera, + camera_eval, width, height, IB_rect, diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index 1a2ff08bd08..1215cb78b56 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -114,7 +114,6 @@ static void sequence_invalidate_cache(Scene *scene, Editing *ed = scene->ed; if (invalidate_self) { - SEQ_relations_sequence_free_anim(seq); seq_cache_cleanup_sequence(scene, seq, seq, invalidate_types, false); } |