Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d9703358
authored
Apr 20, 2020
by
ibaker
Committed by
Oliver Woodman
May 27, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use anti-aliasing and bitmap filtering for bitmap subtitles
issue:#6950 PiperOrigin-RevId: 307411067
parent
a697905c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
RELEASENOTES.md
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java
RELEASENOTES.md
View file @
d9703358
<<<<<<< HEAD
# Release notes #
### Next release ###
...
...
@@ -15,6 +16,9 @@
marked with the
`C.ROLE_FLAG_TRICK_PLAY`
flag.
*
MPEG-TS: Fix issue where SEI NAL units were incorrectly dropped from H.265
samples (
[
#7113
](
https://github.com/google/ExoPlayer/issues/7113
)
).
*
Text
*
Use anti-aliasing and bitmap filtering when displaying bitmap subtitles
(
[
#6950
](
https://github.com/google/ExoPlayer/pull/6950
)
).
### 2.11.4 (2020-04-08) ###
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java
View file @
d9703358
...
...
@@ -64,7 +64,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private
final
float
spacingAdd
;
private
final
TextPaint
textPaint
;
private
final
Paint
paint
;
private
final
Paint
windowPaint
;
private
final
Paint
bitmapPaint
;
// Previous input variables.
@Nullable
private
CharSequence
cueText
;
...
...
@@ -122,9 +123,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
textPaint
.
setAntiAlias
(
true
);
textPaint
.
setSubpixelText
(
true
);
paint
=
new
Paint
();
paint
.
setAntiAlias
(
true
);
paint
.
setStyle
(
Style
.
FILL
);
windowPaint
=
new
Paint
();
windowPaint
.
setAntiAlias
(
true
);
windowPaint
.
setStyle
(
Style
.
FILL
);
bitmapPaint
=
new
Paint
();
bitmapPaint
.
setAntiAlias
(
true
);
bitmapPaint
.
setFilterBitmap
(
true
);
}
/**
...
...
@@ -415,9 +420,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
canvas
.
translate
(
textLeft
,
textTop
);
if
(
Color
.
alpha
(
windowColor
)
>
0
)
{
paint
.
setColor
(
windowColor
);
canvas
.
drawRect
(-
textPaddingX
,
0
,
layout
.
getWidth
()
+
textPaddingX
,
layout
.
getHeight
(),
paint
);
windowPaint
.
setColor
(
windowColor
);
canvas
.
drawRect
(
-
textPaddingX
,
0
,
textLayout
.
getWidth
()
+
textPaddingX
,
textLayout
.
getHeight
(),
windowPaint
);
}
if
(
edgeType
==
CaptionStyleCompat
.
EDGE_TYPE_OUTLINE
)
{
...
...
@@ -451,7 +460,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@RequiresNonNull
({
"cueBitmap"
,
"bitmapRect"
})
private
void
drawBitmapLayout
(
Canvas
canvas
)
{
canvas
.
drawBitmap
(
cueBitmap
,
/* src= */
null
,
bitmapRect
,
/* paint= */
null
);
canvas
.
drawBitmap
(
cueBitmap
,
/* src= */
null
,
bitmapRect
,
bitmapPaint
);
}
/**
...
...
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