[vlc-commits] freetype: do not render transparent overlayed content

Francois Cartegnie git at videolan.org
Mon Aug 24 22:45:44 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Aug 23 23:56:20 2015 +0200| [f5eb3ce24da279843c6cb2039535074681991f4a] | committer: Francois Cartegnie

freetype: do not render transparent overlayed content

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

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

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index e11db31..5de6a43 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -744,10 +744,13 @@ static inline void RenderBackground( subpicture_region_t *p_region,
                                                            p_char->p_style->i_background_alpha;
 
             /* Render the actual background */
-            for( int dy = line_top; dy < line_bottom; dy++ )
+            if( i_alpha != STYLE_ALPHA_TRANSPARENT )
             {
-                for( int dx = line_start; dx < line_end; dx++ )
-                    BlendPixel( p_picture, dx, dy, i_alpha, i_x, i_y, i_z, 0xff );
+                for( int dy = line_top; dy < line_bottom; dy++ )
+                {
+                    for( int dx = line_start; dx < line_end; dx++ )
+                        BlendPixel( p_picture, dx, dy, i_alpha, i_x, i_y, i_z, 0xff );
+                }
             }
 
             line_start = line_end;
@@ -831,8 +834,11 @@ 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) {
+                switch (g) {/* Apply font alpha ratio to shadow/outline alpha */
                 case 0:
                     i_a     = i_a * p_sys->p_style->i_shadow_alpha / 255;
                     i_color = p_sys->p_style->i_shadow_color;



More information about the vlc-commits mailing list