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
2b526db0
Commit
2b526db0
authored
May 12, 2015
by
Salah-Eddin Shaban
Committed by
Jean-Baptiste Kempf
May 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype: avoid redundant calls to FT_Set_Pixel_Sizes()
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
537d4556
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
modules/text_renderer/freetype.c
modules/text_renderer/freetype.c
+11
-0
modules/text_renderer/text_layout.c
modules/text_renderer/text_layout.c
+9
-15
No files found.
modules/text_renderer/freetype.c
View file @
2b526db0
...
@@ -1442,6 +1442,17 @@ FT_Face LoadFace( filter_t *p_filter,
...
@@ -1442,6 +1442,17 @@ FT_Face LoadFace( filter_t *p_filter,
return
NULL
;
return
NULL
;
}
}
int
i_font_width
=
p_style
->
i_style_flags
&
STYLE_HALFWIDTH
?
p_style
->
i_font_size
/
2
:
p_style
->
i_font_size
;
if
(
FT_Set_Pixel_Sizes
(
p_face
,
i_font_width
,
p_style
->
i_font_size
)
)
{
msg_Err
(
p_filter
,
"Failed to set font size to %d"
,
p_style
->
i_font_size
);
FT_Done_Face
(
p_face
);
return
NULL
;
}
if
(
p_cache
->
i_faces_count
==
p_cache
->
i_cache_size
)
if
(
p_cache
->
i_faces_count
==
p_cache
->
i_cache_size
)
{
{
FT_Face
*
p_new_faces
=
FT_Face
*
p_new_faces
=
...
...
modules/text_renderer/text_layout.c
View file @
2b526db0
...
@@ -517,19 +517,16 @@ static int ShapeParagraphHarfBuzz( filter_t *p_filter,
...
@@ -517,19 +517,16 @@ static int ShapeParagraphHarfBuzz( filter_t *p_filter,
{
{
p_face
=
LoadFace
(
p_filter
,
p_style
);
p_face
=
LoadFace
(
p_filter
,
p_style
);
if
(
!
p_face
)
if
(
!
p_face
)
{
p_face
=
p_sys
->
p_face
;
p_face
=
p_sys
->
p_face
;
p_style
=
&
p_sys
->
style
;
p_run
->
p_style
=
p_style
;
}
p_run
->
p_face
=
p_face
;
p_run
->
p_face
=
p_face
;
}
}
else
else
p_face
=
p_run
->
p_face
;
p_face
=
p_run
->
p_face
;
int
i_font_width
=
p_style
->
i_style_flags
&
STYLE_HALFWIDTH
?
p_style
->
i_font_size
/
2
:
p_style
->
i_font_size
;
if
(
FT_Set_Pixel_Sizes
(
p_face
,
i_font_width
,
p_style
->
i_font_size
)
)
msg_Err
(
p_filter
,
"Failed to set font size to %d"
,
p_style
->
i_font_size
);
p_run
->
p_hb_font
=
hb_ft_font_create
(
p_face
,
0
);
p_run
->
p_hb_font
=
hb_ft_font_create
(
p_face
,
0
);
if
(
!
p_run
->
p_hb_font
)
if
(
!
p_run
->
p_hb_font
)
{
{
...
@@ -773,24 +770,21 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
...
@@ -773,24 +770,21 @@ static int LoadGlyphs( filter_t *p_filter, paragraph_t *p_paragraph,
run_desc_t
*
p_run
=
p_paragraph
->
p_runs
+
i
;
run_desc_t
*
p_run
=
p_paragraph
->
p_runs
+
i
;
text_style_t
*
p_style
=
p_run
->
p_style
;
text_style_t
*
p_style
=
p_run
->
p_style
;
FT_Face
p_face
;
FT_Face
p_face
=
0
;
if
(
!
p_run
->
p_face
)
if
(
!
p_run
->
p_face
)
{
{
p_face
=
LoadFace
(
p_filter
,
p_style
);
p_face
=
LoadFace
(
p_filter
,
p_style
);
if
(
!
p_face
)
if
(
!
p_face
)
{
p_face
=
p_sys
->
p_face
;
p_face
=
p_sys
->
p_face
;
p_style
=
&
p_sys
->
style
;
p_run
->
p_style
=
p_style
;
}
p_run
->
p_face
=
p_face
;
p_run
->
p_face
=
p_face
;
}
}
else
else
p_face
=
p_run
->
p_face
;
p_face
=
p_run
->
p_face
;
int
i_font_width
=
p_style
->
i_style_flags
&
STYLE_HALFWIDTH
?
p_style
->
i_font_size
/
2
:
p_style
->
i_font_size
;
if
(
FT_Set_Pixel_Sizes
(
p_face
,
i_font_width
,
p_style
->
i_font_size
)
)
msg_Err
(
p_filter
,
"Failed to set font size to %d"
,
p_style
->
i_font_size
);
if
(
p_sys
->
p_stroker
)
if
(
p_sys
->
p_stroker
)
{
{
double
f_outline_thickness
=
double
f_outline_thickness
=
...
...
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