[vlc-commits] freetype: only render visible bitmaps

Francois Cartegnie git at videolan.org
Fri Aug 21 00:42:26 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 21 00:37:42 2015 +0200| [c14d76739b36b76162f01aff70a9db3ab4b9dd38] | committer: Francois Cartegnie

freetype: only render visible bitmaps

and use limits to render underline/strikethrough correctly

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c14d76739b36b76162f01aff70a9db3ab4b9dd38
---

 modules/text_renderer/freetype.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 562edac..592bd15 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -801,7 +801,7 @@ static inline int RenderAXYZ( filter_t *p_filter,
             int i_align_top = i_margin;
 
             /* Render all glyphs and underline/strikethrough */
-            for( int i = 0; i < p_line->i_character_count; i++ )
+            for( int i = p_line->i_first_visible_char_index; i <= p_line->i_last_visible_char_index; i++ )
             {
                 const line_character_t *ch = &p_line->p_character[i];
                 const FT_BitmapGlyph p_glyph = g == 0 ? ch->p_shadow : g == 1 ? ch->p_outline : ch->p_glyph;
@@ -835,7 +835,7 @@ static inline int RenderAXYZ( filter_t *p_filter,
                                 BlendPixel );
 
                 /* underline/strikethrough are only rendered for the normal glyph */
-                if( g == 2 && ch->i_line_thickness > 0 && p_glyph->bitmap.rows )
+                if( g == 2 && ch->i_line_thickness > 0 )
                     BlendAXYZLine( p_picture,
                                    i_glyph_x, i_glyph_y + p_glyph->top,
                                    i_a, i_x, i_y, i_z,



More information about the vlc-commits mailing list