Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
938804ff
Commit
938804ff
authored
Jun 11, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small simplifications (freetype).
parent
97e233d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/freetype.c
+8
-12
No files found.
modules/misc/text_renderer/freetype.c
View file @
938804ff
...
@@ -1515,9 +1515,7 @@ static text_style_t *GetStyleFromFontStack( filter_sys_t *p_sys,
...
@@ -1515,9 +1515,7 @@ static text_style_t *GetStyleFromFontStack( filter_sys_t *p_sys,
}
}
static
int
RenderTag
(
filter_t
*
p_filter
,
FT_Face
p_face
,
static
int
RenderTag
(
filter_t
*
p_filter
,
FT_Face
p_face
,
int
i_font_color
,
const
text_style_t
*
p_style
,
int
i_style_flags
,
int
i_karaoke_bgcolor
,
line_desc_t
*
p_line
,
uint32_t
*
psz_unicode
,
line_desc_t
*
p_line
,
uint32_t
*
psz_unicode
,
int
*
pi_pen_x
,
int
i_pen_y
,
int
*
pi_start
,
int
*
pi_pen_x
,
int
i_pen_y
,
int
*
pi_start
,
FT_Vector
*
p_result
)
FT_Vector
*
p_result
)
...
@@ -1588,9 +1586,9 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
...
@@ -1588,9 +1586,9 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
* ie. if the font we have loaded is NOT already in the
* ie. if the font we have loaded is NOT already in the
* style that the tags want, then switch it on; if they
* style that the tags want, then switch it on; if they
* are then don't. */
* are then don't. */
if
((
i_style_flags
&
STYLE_BOLD
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
))
if
((
p_style
->
i_style_flags
&
STYLE_BOLD
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_BOLD
))
FT_GlyphSlot_Embolden
(
p_face
->
glyph
);
FT_GlyphSlot_Embolden
(
p_face
->
glyph
);
if
((
i_style_flags
&
STYLE_ITALIC
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_ITALIC
))
if
((
p_style
->
i_style_flags
&
STYLE_ITALIC
)
&&
!
(
p_face
->
style_flags
&
FT_STYLE_FLAG_ITALIC
))
FT_GlyphSlot_Oblique
(
p_face
->
glyph
);
FT_GlyphSlot_Oblique
(
p_face
->
glyph
);
i_error
=
FT_Get_Glyph
(
p_face
->
glyph
,
&
tmp_glyph
);
i_error
=
FT_Get_Glyph
(
p_face
->
glyph
,
&
tmp_glyph
);
...
@@ -1608,7 +1606,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
...
@@ -1608,7 +1606,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
FT_Done_Glyph
(
tmp_glyph
);
FT_Done_Glyph
(
tmp_glyph
);
continue
;
continue
;
}
}
if
(
i_style_flags
&
(
STYLE_UNDERLINE
|
STYLE_STRIKEOUT
)
)
if
(
p_style
->
i_style_flags
&
(
STYLE_UNDERLINE
|
STYLE_STRIKEOUT
)
)
{
{
float
aOffset
=
FT_FLOOR
(
FT_MulFix
(
p_face
->
underline_position
,
float
aOffset
=
FT_FLOOR
(
FT_MulFix
(
p_face
->
underline_position
,
p_face
->
size
->
metrics
.
y_scale
));
p_face
->
size
->
metrics
.
y_scale
));
...
@@ -1619,7 +1617,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
...
@@ -1619,7 +1617,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
(
aOffset
<
0
)
?
-
aOffset
:
aOffset
;
(
aOffset
<
0
)
?
-
aOffset
:
aOffset
;
p_line
->
pi_underline_thickness
[
i
]
=
p_line
->
pi_underline_thickness
[
i
]
=
(
aSize
<
0
)
?
-
aSize
:
aSize
;
(
aSize
<
0
)
?
-
aSize
:
aSize
;
if
(
i_style_flags
&
STYLE_STRIKEOUT
)
if
(
p_style
->
i_style_flags
&
STYLE_STRIKEOUT
)
{
{
/* Move the baseline to make it strikethrough instead of
/* Move the baseline to make it strikethrough instead of
* underline. That means that strikethrough takes precedence
* underline. That means that strikethrough takes precedence
...
@@ -1633,8 +1631,8 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
...
@@ -1633,8 +1631,8 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face,
}
}
p_line
->
pp_glyphs
[
i
]
=
(
FT_BitmapGlyph
)
tmp_glyph
;
p_line
->
pp_glyphs
[
i
]
=
(
FT_BitmapGlyph
)
tmp_glyph
;
p_line
->
p_fg_rgb
[
i
]
=
i_font_color
;
p_line
->
p_fg_rgb
[
i
]
=
p_style
->
i_font_color
;
p_line
->
p_bg_rgb
[
i
]
=
i_karaoke_bg
color
;
p_line
->
p_bg_rgb
[
i
]
=
p_style
->
i_karaoke_background_
color
;
p_line
->
p_fg_bg_ratio
[
i
]
=
0x00
;
p_line
->
p_fg_bg_ratio
[
i
]
=
0x00
;
line
.
xMax
=
p_line
->
p_glyph_pos
[
i
].
x
+
glyph_size
.
xMax
-
line
.
xMax
=
p_line
->
p_glyph_pos
[
i
].
x
+
glyph_size
.
xMax
-
...
@@ -2338,9 +2336,7 @@ static int ProcessLines( filter_t *p_filter,
...
@@ -2338,9 +2336,7 @@ static int ProcessLines( filter_t *p_filter,
}
}
if
(
RenderTag
(
p_filter
,
p_face
?
p_face
:
p_sys
->
p_face
,
if
(
RenderTag
(
p_filter
,
p_face
?
p_face
:
p_sys
->
p_face
,
p_style
->
i_font_color
,
p_style
,
p_style
->
i_style_flags
,
p_style
->
i_karaoke_background_color
,
p_line
,
psz_unicode
,
&
i_pen_x
,
i_pen_y
,
&
i_posn
,
p_line
,
psz_unicode
,
&
i_pen_x
,
i_pen_y
,
&
i_posn
,
&
tmp_result
)
!=
VLC_SUCCESS
)
&
tmp_result
)
!=
VLC_SUCCESS
)
{
{
...
...
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