Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-13 02:50:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-13 02:50:21 +0400
commit10f631094c158ff2fdb49fc9236e699fb91ed015 (patch)
treedeb75dc6d040ad4bae45994d34bf5e150e3b29a1 /source/blender/blenfont
parent866f986898cf6c35e8b4d5190853e453a3eb1714 (diff)
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.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/BLF_api.h6
-rw-r--r--source/blender/blenfont/intern/blf.c4
-rw-r--r--source/blender/blenfont/intern/blf_font.c8
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h2
4 files changed, 10 insertions, 10 deletions
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 */