1 From 26e2d3906658c30f2f88f4b1bc9630ec43bf5525 Mon Sep 17 00:00:00 2001
2 From: Shaleen Jain <shaleen@jain.sh>
3 Date: Sun, 25 Feb 2018 18:42:27 +0530
4 Subject: [PATCH] fribidi: update for version 1.0
6 Update functions deprecated in version 1.0 when building with release 1.0 and
9 Signed-off-by: Thomas Guillem <thomas@gllm.fr>
11 modules/text_renderer/freetype/text_layout.c | 24 ++++++++++++++++++++++++
12 1 file changed, 24 insertions(+)
14 diff --git a/modules/text_renderer/freetype/text_layout.c b/modules/text_renderer/freetype/text_layout.c
15 index 13efd567b46..1a28786d097 100644
16 --- a/modules/text_renderer/freetype/text_layout.c
17 +++ b/modules/text_renderer/freetype/text_layout.c
18 @@ -153,6 +153,9 @@ typedef struct paragraph_t
21 FriBidiCharType *p_types;
22 +#if FRIBIDI_MAJOR_VERSION >= 1
23 + FriBidiBracketType *p_btypes;
25 FriBidiLevel *p_levels;
26 FriBidiStrIndex *pi_reordered_indices;
27 FriBidiParType paragraph_type;
28 @@ -361,6 +364,9 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
30 p_paragraph->p_levels = vlc_alloc( i_size, sizeof( *p_paragraph->p_levels ) );
31 p_paragraph->p_types = vlc_alloc( i_size, sizeof( *p_paragraph->p_types ) );
32 +#if FRIBIDI_MAJOR_VERSION >= 1
33 + p_paragraph->p_btypes = vlc_alloc( i_size, sizeof( *p_paragraph->p_btypes ) );
35 p_paragraph->pi_reordered_indices =
36 vlc_alloc( i_size, sizeof( *p_paragraph->pi_reordered_indices ) );
38 @@ -398,6 +404,9 @@ static paragraph_t *NewParagraph( filter_t *p_filter,
40 if( p_paragraph->p_levels ) free( p_paragraph->p_levels );
41 if( p_paragraph->p_types ) free( p_paragraph->p_types );
42 +#if FRIBIDI_MAJOR_VERSION >= 1
43 + if( p_paragraph->p_btypes ) free( p_paragraph->p_btypes );
45 if( p_paragraph->pi_reordered_indices )
46 free( p_paragraph->pi_reordered_indices );
48 @@ -424,6 +433,9 @@ static void FreeParagraph( paragraph_t *p_paragraph )
50 free( p_paragraph->pi_reordered_indices );
51 free( p_paragraph->p_types );
52 +#if FRIBIDI_MAJOR_VERSION >= 1
53 + free( p_paragraph->p_btypes );
55 free( p_paragraph->p_levels );
58 @@ -436,10 +448,22 @@ static int AnalyzeParagraph( paragraph_t *p_paragraph )
59 fribidi_get_bidi_types( p_paragraph->p_code_points,
61 p_paragraph->p_types );
62 +#if FRIBIDI_MAJOR_VERSION >= 1
63 + fribidi_get_bracket_types( p_paragraph->p_code_points,
64 + p_paragraph->i_size,
65 + p_paragraph->p_types,
66 + p_paragraph->p_btypes );
67 + fribidi_get_par_embedding_levels_ex( p_paragraph->p_types,
68 + p_paragraph->p_btypes,
69 + p_paragraph->i_size,
70 + &p_paragraph->paragraph_type,
71 + p_paragraph->p_levels );
73 fribidi_get_par_embedding_levels( p_paragraph->p_types,
75 &p_paragraph->paragraph_type,
76 p_paragraph->p_levels );
80 hb_unicode_funcs_t *p_funcs = hb_unicode_funcs_get_default();