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
02522fbf
Commit
02522fbf
authored
Apr 02, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freetype: code cosmetics
parent
120546d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
modules/misc/text_renderer/freetype.c
modules/misc/text_renderer/freetype.c
+13
-19
No files found.
modules/misc/text_renderer/freetype.c
View file @
02522fbf
...
@@ -205,12 +205,12 @@ static int RenderHtml( filter_t *, subpicture_region_t *,
...
@@ -205,12 +205,12 @@ static int RenderHtml( filter_t *, subpicture_region_t *,
#endif
#endif
#ifdef HAVE_FONTCONFIG
#ifdef HAVE_FONTCONFIG
static
void
FontConfig_BuildCache
(
filter_t
*
);
static
void
FontConfig_BuildCache
(
filter_t
*
);
static
char
*
FontConfig_Select
(
FcConfig
*
,
const
char
*
,
static
char
*
FontConfig_Select
(
FcConfig
*
,
const
char
*
,
bool
,
bool
,
int
,
int
*
);
bool
,
bool
,
int
,
int
*
);
#endif
#endif
#ifdef WIN32
#ifdef WIN32
static
char
*
Win32_Select
(
filter_t
*
p_filter
,
const
char
*
family
,
bool
b_bold
,
static
char
*
Win32_Select
(
filter_t
*
,
const
char
*
,
bool
b_italic
,
int
i_size
,
int
*
i_idx
);
bool
,
bool
,
int
,
int
*
);
#endif
#endif
static
int
LoadFontsFromAttachments
(
filter_t
*
p_filter
);
static
int
LoadFontsFromAttachments
(
filter_t
*
p_filter
);
...
@@ -464,9 +464,7 @@ static void Destroy( vlc_object_t *p_this )
...
@@ -464,9 +464,7 @@ static void Destroy( vlc_object_t *p_this )
if
(
p_sys
->
pp_font_attachments
)
if
(
p_sys
->
pp_font_attachments
)
{
{
int
k
;
for
(
int
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
for
(
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
vlc_input_attachment_Delete
(
p_sys
->
pp_font_attachments
[
k
]
);
vlc_input_attachment_Delete
(
p_sys
->
pp_font_attachments
[
k
]
);
free
(
p_sys
->
pp_font_attachments
);
free
(
p_sys
->
pp_font_attachments
);
...
@@ -674,7 +672,6 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
...
@@ -674,7 +672,6 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
uint8_t
i_y
,
uint8_t
i_u
,
uint8_t
i_v
,
uint8_t
i_y
,
uint8_t
i_u
,
uint8_t
i_v
,
subpicture_region_t
*
p_region
)
subpicture_region_t
*
p_region
)
{
{
int
y
,
x
,
z
;
int
i_pitch
;
int
i_pitch
;
uint8_t
*
p_dst_y
,
*
p_dst_u
,
*
p_dst_v
,
*
p_dst_a
;
uint8_t
*
p_dst_y
,
*
p_dst_u
,
*
p_dst_v
,
*
p_dst_a
;
...
@@ -687,7 +684,7 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
...
@@ -687,7 +684,7 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
int
i_offset
=
(
p_this_glyph_pos
->
y
+
i_glyph_tmax
+
i_line_offset
+
3
)
*
i_pitch
+
int
i_offset
=
(
p_this_glyph_pos
->
y
+
i_glyph_tmax
+
i_line_offset
+
3
)
*
i_pitch
+
p_this_glyph_pos
->
x
+
p_this_glyph
->
left
+
3
+
i_align_offset
;
p_this_glyph_pos
->
x
+
p_this_glyph
->
left
+
3
+
i_align_offset
;
for
(
y
=
0
;
y
<
i_line_thickness
;
y
++
)
for
(
int
y
=
0
;
y
<
i_line_thickness
;
y
++
)
{
{
int
i_extra
=
p_this_glyph
->
bitmap
.
width
;
int
i_extra
=
p_this_glyph
->
bitmap
.
width
;
...
@@ -696,13 +693,13 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
...
@@ -696,13 +693,13 @@ static void UnderlineGlyphYUVA( int i_line_thickness, int i_line_offset, bool b_
i_extra
=
(
p_next_glyph_pos
->
x
+
p_next_glyph
->
left
)
-
i_extra
=
(
p_next_glyph_pos
->
x
+
p_next_glyph
->
left
)
-
(
p_this_glyph_pos
->
x
+
p_this_glyph
->
left
);
(
p_this_glyph_pos
->
x
+
p_this_glyph
->
left
);
}
}
for
(
x
=
0
;
x
<
i_extra
;
x
++
)
for
(
int
x
=
0
;
x
<
i_extra
;
x
++
)
{
{
bool
b_ok
=
true
;
bool
b_ok
=
true
;
/* break the underline around the tails of any glyphs which cross it */
/* break the underline around the tails of any glyphs which cross it */
/* Strikethrough doesn't get broken */
/* Strikethrough doesn't get broken */
for
(
z
=
x
-
i_line_thickness
;
for
(
int
z
=
x
-
i_line_thickness
;
z
<
x
+
i_line_thickness
&&
b_ok
&&
(
i_line_offset
>=
0
);
z
<
x
+
i_line_thickness
&&
b_ok
&&
(
i_line_offset
>=
0
);
z
++
)
z
++
)
{
{
...
@@ -744,7 +741,7 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
...
@@ -744,7 +741,7 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
{
{
uint8_t
*
p_dst
=
p_region
->
p_picture
->
A_PIXELS
;
uint8_t
*
p_dst
=
p_region
->
p_picture
->
A_PIXELS
;
int
i_pitch
=
p_region
->
p_picture
->
A_PITCH
;
int
i_pitch
=
p_region
->
p_picture
->
A_PITCH
;
int
x
,
y
;
int
y
;
for
(
;
p_line
!=
NULL
;
p_line
=
p_line
->
p_next
)
for
(
;
p_line
!=
NULL
;
p_line
=
p_line
->
p_next
)
{
{
...
@@ -779,7 +776,7 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
...
@@ -779,7 +776,7 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
{
{
for
(
x
=
0
;
x
<
p_glyph
->
bitmap
.
width
;
x
++
,
i_bitmap_offset
++
)
for
(
int
x
=
0
;
x
<
p_glyph
->
bitmap
.
width
;
x
++
,
i_bitmap_offset
++
)
{
{
if
(
p_glyph
->
bitmap
.
buffer
[
i_bitmap_offset
]
)
if
(
p_glyph
->
bitmap
.
buffer
[
i_bitmap_offset
]
)
if
(
p_dst
[
i_offset
+
x
]
<
if
(
p_dst
[
i_offset
+
x
]
<
...
@@ -791,7 +788,6 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
...
@@ -791,7 +788,6 @@ static void DrawBlack( line_desc_t *p_line, int i_width, subpicture_region_t *p_
}
}
}
}
}
}
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -804,7 +800,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
...
@@ -804,7 +800,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
{
{
uint8_t
*
p_dst_y
,
*
p_dst_u
,
*
p_dst_v
,
*
p_dst_a
;
uint8_t
*
p_dst_y
,
*
p_dst_u
,
*
p_dst_v
,
*
p_dst_a
;
video_format_t
fmt
;
video_format_t
fmt
;
int
i
,
x
,
y
,
i_pitch
,
i_alpha
;
int
i
,
y
,
i_pitch
,
i_alpha
;
uint8_t
i_y
,
i_u
,
i_v
;
/* YUV values, derived from incoming RGB */
uint8_t
i_y
,
i_u
,
i_v
;
/* YUV values, derived from incoming RGB */
if
(
i_width
==
0
||
i_height
==
0
)
if
(
i_width
==
0
||
i_height
==
0
)
...
@@ -926,7 +922,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
...
@@ -926,7 +922,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
for
(
y
=
0
,
i_bitmap_offset
=
0
;
y
<
p_glyph
->
bitmap
.
rows
;
y
++
)
{
{
for
(
x
=
0
;
x
<
p_glyph
->
bitmap
.
width
;
x
++
,
i_bitmap_offset
++
)
for
(
int
x
=
0
;
x
<
p_glyph
->
bitmap
.
width
;
x
++
,
i_bitmap_offset
++
)
{
{
uint8_t
i_y_local
=
i_y
;
uint8_t
i_y_local
=
i_y
;
uint8_t
i_u_local
=
i_u
;
uint8_t
i_u_local
=
i_u
;
...
@@ -1379,7 +1375,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face, int i_font_color,
...
@@ -1379,7 +1375,7 @@ static int RenderTag( filter_t *p_filter, FT_Face p_face, int i_font_color,
line
.
xMin
=
line
.
xMax
=
line
.
yMin
=
line
.
yMax
=
0
;
line
.
xMin
=
line
.
xMax
=
line
.
yMin
=
line
.
yMax
=
0
;
/* Account for part of line already in position */
/* Account for part of line already in position */
for
(
i
=
0
;
i
<*
pi_start
;
i
++
)
for
(
i
=
0
;
i
<*
pi_start
;
i
++
)
{
{
FT_BBox
glyph_size
;
FT_BBox
glyph_size
;
...
@@ -1622,9 +1618,7 @@ static void SetupLine( filter_t *p_filter, const char *psz_text_in,
...
@@ -1622,9 +1618,7 @@ static void SetupLine( filter_t *p_filter, const char *psz_text_in,
static
int
CheckForEmbeddedFont
(
filter_sys_t
*
p_sys
,
FT_Face
*
pp_face
,
ft_style_t
*
p_style
)
static
int
CheckForEmbeddedFont
(
filter_sys_t
*
p_sys
,
FT_Face
*
pp_face
,
ft_style_t
*
p_style
)
{
{
int
k
;
for
(
int
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
for
(
k
=
0
;
k
<
p_sys
->
i_font_attachments
;
k
++
)
{
{
input_attachment_t
*
p_attach
=
p_sys
->
pp_font_attachments
[
k
];
input_attachment_t
*
p_attach
=
p_sys
->
pp_font_attachments
[
k
];
int
i_font_idx
=
0
;
int
i_font_idx
=
0
;
...
...
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