From 10f631094c158ff2fdb49fc9236e699fb91ed015 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Aug 2012 22:50:21 +0000 Subject: fix [#32126] STAMP: Setting a background color causes color flicker when rendering the sequencer can output float or char buffers which stamp wasn't accounting for. --- source/blender/blenfont/BLF_api.h | 6 +++--- source/blender/blenfont/intern/blf.c | 4 ++-- source/blender/blenfont/intern/blf_font.c | 8 ++++---- source/blender/blenfont/intern/blf_internal_types.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/blenfont') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 7f50e157f09..0732e02b5fc 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -145,13 +145,13 @@ void BLF_shadow_offset(int fontid, int x, int y); /* Set the buffer, size and number of channels to draw, one thing to take care is call * this function with NULL pointer when we finish, for example: * - * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4); + * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4, TRUE); * * ... set color, position and draw ... * - * BLF_buffer(NULL, NULL, 0, 0, 0); + * BLF_buffer(NULL, NULL, 0, 0, 0, FALSE); */ -void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int is_linear); +void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management); /* Set the color to be used for text. */ void BLF_buffer_col(int fontid, float r, float g, float b, float a); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 6857ec7874d..d4739b37f93 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -746,7 +746,7 @@ void BLF_shadow_offset(int fontid, int x, int y) } } -void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int is_linear) +void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management) { FontBLF *font = BLF_get(fontid); @@ -756,7 +756,7 @@ void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int font->buf_info.w = w; font->buf_info.h = h; font->buf_info.ch = nch; - font->buf_info.is_linear = is_linear; + font->buf_info.do_color_management = do_color_management; } } diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 97b88028868..dcefcc68d23 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -243,7 +243,7 @@ void blf_font_buffer(FontBLF *font, const char *str) blf_font_ensure_ascii_table(font); /* another buffer spesific call for color conversion */ - if (buf_info->is_linear) { + if (buf_info->do_color_management) { srgb_to_linearrgb_v4(b_col_float, buf_info->col); } else { @@ -304,9 +304,9 @@ void blf_font_buffer(FontBLF *font, const char *str) fbuf[3] = (alphatest = (fbuf[3] + (b_col_float[3]))) < 1.0f ? alphatest : 1.0f; } else { - fbuf[0] = (b_col_float[0] * a) + (fbuf[0] * (1 - a)); - fbuf[1] = (b_col_float[1] * a) + (fbuf[1] * (1 - a)); - fbuf[2] = (b_col_float[2] * a) + (fbuf[2] * (1 - a)); + 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] = (alphatest = (fbuf[3] + (b_col_float[3] * a))) < 1.0f ? alphatest : 1.0f; } } diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 177b02a9598..4c617da7583 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -146,7 +146,7 @@ typedef struct FontBufInfoBLF { int ch; /* is the float buffer linear */ - int is_linear; + int do_color_management; /* and the color, the alphas is get from the glyph! * color is srgb space */ -- cgit v1.2.3