[vlc-commits] text_renderer: freetype: bind linedesc to textblock

Francois Cartegnie git at videolan.org
Fri Feb 16 19:38:09 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 12 13:57:49 2018 +0100| [c41fc5e53c26d8c38fad48d5b7c3b20f069402c2] | committer: Francois Cartegnie

text_renderer: freetype: bind linedesc to textblock

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

 modules/text_renderer/freetype/freetype.c    | 13 ++++++-------
 modules/text_renderer/freetype/text_layout.h |  2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index a7f97d7d49..f10d8823ac 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -1131,7 +1131,6 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
     int rv = VLC_SUCCESS;
     FT_BBox bbox;
     int i_max_face_height;
-    line_desc_t *p_lines = NULL;
 
     unsigned i_max_width = p_filter->fmt_out.video.i_visible_width;
     if( p_region_in->i_max_width > 0 && (unsigned) p_region_in->i_max_width < i_max_width )
@@ -1154,7 +1153,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
 
     text_block.i_max_width = i_max_width;
     text_block.i_max_height = i_max_height;
-    rv = LayoutTextBlock( p_filter, &text_block, &p_lines, &bbox, &i_max_face_height );
+    rv = LayoutTextBlock( p_filter, &text_block, &text_block.p_laid, &bbox, &i_max_face_height );
 
     /* Don't attempt to render text that couldn't be layed out
      * properly. */
@@ -1243,24 +1242,24 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
         {
             rv = VLC_EGENERIC;
             if( *p_chroma == VLC_CODEC_YUVP )
-                rv = RenderYUVP( p_filter, p_region_out, p_lines,
+                rv = RenderYUVP( p_filter, p_region_out, text_block.p_laid,
                                  &regionbbox, &paddedbbox, &bbox );
             else if( *p_chroma == VLC_CODEC_YUVA )
-                rv = RenderAXYZ( p_filter, p_region_out, p_lines,
+                rv = RenderAXYZ( p_filter, p_region_out, text_block.p_laid,
                                  &regionbbox, &paddedbbox, &bbox,
                                  VLC_CODEC_YUVA,
                                  YUVFromRGB,
                                  FillYUVAPicture,
                                  BlendYUVAPixel );
             else if( *p_chroma == VLC_CODEC_RGBA )
-                rv = RenderAXYZ( p_filter, p_region_out, p_lines,
+                rv = RenderAXYZ( p_filter, p_region_out, text_block.p_laid,
                                  &regionbbox, &paddedbbox, &bbox,
                                  VLC_CODEC_RGBA,
                                  RGBFromRGB,
                                  FillRGBAPicture,
                                  BlendRGBAPixel );
             else if( *p_chroma == VLC_CODEC_ARGB )
-                rv = RenderAXYZ( p_filter, p_region_out, p_lines,
+                rv = RenderAXYZ( p_filter, p_region_out, text_block.p_laid,
                                  &regionbbox, &paddedbbox, &bbox,
                                  VLC_CODEC_ARGB,
                                  RGBFromRGB,
@@ -1278,7 +1277,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region_out,
             var_SetBool( p_filter, "text-rerender", true );
     }
 
-    FreeLines( p_lines );
+    FreeLines( text_block.p_laid );
 
     free( text_block.p_uchars );
     FreeStylesArray( text_block.pp_styles, text_block.i_count );
diff --git a/modules/text_renderer/freetype/text_layout.h b/modules/text_renderer/freetype/text_layout.h
index a1794ce7d9..ea0bca7558 100644
--- a/modules/text_renderer/freetype/text_layout.h
+++ b/modules/text_renderer/freetype/text_layout.h
@@ -78,6 +78,8 @@ typedef struct
     bool b_grid;                /*!< true for balanced wrapped lines */
     unsigned i_max_width;       /*!< maximum available width to layout text */
     unsigned i_max_height;      /*!< maximum available height to layout text */
+
+    line_desc_t *p_laid;
 } layout_text_block_t;
 
 /**



More information about the vlc-commits mailing list