]> git.sesse.net Git - vlc/commitdiff
Don't call the legacy Freetype background renderer if the EIA-608 bg render feature...
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Fri, 11 Jan 2013 19:28:04 +0000 (14:28 -0500)
committerRafaël Carré <funman@videolan.org>
Sat, 12 Jan 2013 07:29:08 +0000 (08:29 +0100)
If we're using the new background renderer which just renders the
background under the text (instead of the entire subpicture block),
then don't call the legacy render as well.  This prevents a alpha-
transparent box from being shown when rendering EIA-608 captions
if the user has the Freetype background opacity set to a nonzero
value.

Signed-off-by: Rafaël Carré <funman@videolan.org>
modules/text_renderer/freetype.c

index 5070462038b5bca88b7160497ee7ee7ec8cfa772..99fa5210d56cc04952e9bb6419e66c3d0a9f3ff0 100644 (file)
@@ -1177,13 +1177,15 @@ static inline int RenderAXYZ( filter_t *p_filter,
     /* Initialize the picture background */
     uint8_t i_a = p_sys->i_background_opacity;
     uint8_t i_x, i_y, i_z;
-    ExtractComponents( p_sys->i_background_color, &i_x, &i_y, &i_z );
-
-    FillPicture( p_picture, i_a, i_x, i_y, i_z );
 
     if (p_region->b_renderbg) {
+        /* Render the background just under the text */
         RenderBackground(p_region, p_line_head, p_bbox, i_margin, p_picture, i_text_width,
                          ExtractComponents, BlendPixel);
+    } else {
+        /* Render background under entire subpicture block */
+        ExtractComponents( p_sys->i_background_color, &i_x, &i_y, &i_z );
+        FillPicture( p_picture, i_a, i_x, i_y, i_z );
     }
 
     /* Render shadow then outline and then normal glyphs */