Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4f9007cf
Commit
4f9007cf
authored
Sep 09, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: simplify ProcessNodes without using p_sys
parent
e1dce21e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+12
-12
No files found.
modules/text_renderer/freetype.c
View file @
4f9007cf
...
...
@@ -1251,10 +1251,10 @@ static int ProcessNodes( filter_t *p_filter,
uint32_t
*
pi_k_dates
,
int
*
pi_len
,
xml_reader_t
*
p_xml_reader
,
text_style_t
*
p_font_style
)
text_style_t
*
p_font_style
,
text_style_t
*
p_default_style
)
{
int
rv
=
VLC_SUCCESS
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
int
i_text_length
=
0
;
font_stack_t
*
p_fonts
=
NULL
;
uint32_t
i_k_date
=
0
;
...
...
@@ -1265,12 +1265,12 @@ static int ProcessNodes( filter_t *p_filter,
{
/* If the font is not specified in the style, assume the system font */
if
(
!
p_font_style
->
psz_fontname
)
p_font_style
->
psz_fontname
=
strdup
(
p_
sys
->
style
.
psz_fontname
);
p_font_style
->
psz_fontname
=
strdup
(
p_
default_style
->
psz_fontname
);
rv
=
PushFont
(
&
p_fonts
,
p_font_style
->
psz_fontname
,
p_font_style
->
i_font_size
>
0
?
p_font_style
->
i_font_size
:
p_
sys
->
style
.
i_font_size
,
:
p_
default_style
->
i_font_size
,
(
p_font_style
->
i_font_color
&
0xffffff
)
|
((
p_font_style
->
i_font_alpha
&
0xff
)
<<
24
),
(
p_font_style
->
i_karaoke_background_color
&
0xffffff
)
|
...
...
@@ -1283,18 +1283,18 @@ static int ProcessNodes( filter_t *p_filter,
}
else
{
uint32_t
i_font_size
=
p_
sys
->
style
.
i_font_size
;
uint32_t
i_font_size
=
p_
default_style
->
i_font_size
;
uint32_t
i_font_color
=
var_InheritInteger
(
p_filter
,
"freetype-color"
);
i_font_color
=
VLC_CLIP
(
i_font_color
,
0
,
0xFFFFFF
);
int
i_font_alpha
=
p_
sys
->
style
.
i_font_alpha
;
int
i_font_alpha
=
p_
default_style
->
i_font_alpha
;
rv
=
PushFont
(
&
p_fonts
,
p_
sys
->
style
.
psz_fontname
,
p_
default_style
->
psz_fontname
,
i_font_size
,
(
i_font_color
&
0xffffff
)
|
((
i_font_alpha
&
0xff
)
<<
24
),
0x00ffffff
);
}
if
(
p_
sys
->
style
.
i_style_flags
&
STYLE_BOLD
)
if
(
p_
default_style
->
i_style_flags
&
STYLE_BOLD
)
i_style_flags
|=
STYLE_BOLD
;
if
(
rv
!=
VLC_SUCCESS
)
...
...
@@ -1326,7 +1326,7 @@ static int ProcessNodes( filter_t *p_filter,
if
(
!
strcasecmp
(
"font"
,
node
)
)
HandleFontAttributes
(
p_xml_reader
,
&
p_fonts
);
else
if
(
!
strcasecmp
(
"tt"
,
node
)
)
HandleTT
(
&
p_fonts
,
p_
sys
->
style
.
psz_monofontname
);
HandleTT
(
&
p_fonts
,
p_
default_style
->
psz_monofontname
);
else
if
(
!
strcasecmp
(
"b"
,
node
)
)
i_style_flags
|=
STYLE_BOLD
;
else
if
(
!
strcasecmp
(
"i"
,
node
)
)
...
...
@@ -1344,7 +1344,7 @@ static int ProcessNodes( filter_t *p_filter,
"
\n
"
,
GetStyleFromFontStack
(
p_filter
,
&
p_fonts
,
&
p_sys
->
style
,
p_default_
style
,
i_style_flags
),
i_k_date
);
}
...
...
@@ -1376,7 +1376,7 @@ static int ProcessNodes( filter_t *p_filter,
psz_node
,
GetStyleFromFontStack
(
p_filter
,
&
p_fonts
,
&
p_sys
->
style
,
p_default_
style
,
i_style_flags
),
i_k_date
);
free
(
psz_node
);
...
...
@@ -2155,7 +2155,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
{
rv
=
ProcessNodes
(
p_filter
,
psz_text
,
pp_styles
,
pi_k_durations
,
&
i_text_length
,
p_xml_reader
,
p_region_in
->
p_style
);
p_xml_reader
,
p_region_in
->
p_style
,
&
p_filter
->
p_sys
->
style
);
}
if
(
p_xml_reader
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment