[vlc-commits] freetype: only render visible glyphs
Francois Cartegnie
git at videolan.org
Mon Aug 24 22:45:45 CEST 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug 24 22:32:26 2015 +0200| [d4b2e75e657353d2e706fed6d5fffc8b77141839] | committer: Francois Cartegnie
freetype: only render visible glyphs
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d4b2e75e657353d2e706fed6d5fffc8b77141839
---
modules/text_renderer/freetype.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 1cc6298..d0ce0ad 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -788,8 +788,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
continue;
i_a = ch->p_style->i_font_alpha;
- if( i_a == STYLE_ALPHA_TRANSPARENT )
- continue;
uint32_t i_color;
switch (g) {/* Apply font alpha ratio to shadow/outline alpha */
@@ -805,6 +803,14 @@ static inline int RenderAXYZ( filter_t *p_filter,
i_color = ch->p_style->i_font_color;
break;
}
+
+ /* Don't render if invisible or not wanted */
+ if( i_a == STYLE_ALPHA_TRANSPARENT ||
+ (g == 0 && 0 == (ch->p_style->i_style_flags & STYLE_SHADOW) ) ||
+ (g == 1 && 0 == (ch->p_style->i_style_flags & STYLE_OUTLINE) )
+ )
+ continue;
+
ExtractComponents( i_color, &i_x, &i_y, &i_z );
int i_glyph_y = i_align_top - p_glyph->top + p_bbox->yMax + p_line->i_base_line;
More information about the vlc-commits
mailing list