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
6a36574a
authored
Apr 20, 2020
by
ibaker
Committed by
Ian Baker
Apr 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
8d0d31e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
RELEASENOTES.md
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java
RELEASENOTES.md
View file @
6a36574a
...
@@ -95,6 +95,8 @@
...
@@ -95,6 +95,8 @@
(a
(a
[
previous draft
](
https://www.w3.org/TR/2014/WD-webvtt1-20141111/#dfn-webvtt-text-position-cue-setting
)
[
previous draft
](
https://www.w3.org/TR/2014/WD-webvtt1-20141111/#dfn-webvtt-text-position-cue-setting
)
used
`start`
,
`middle`
and
`end`
).
used
`start`
,
`middle`
and
`end`
).
*
Use anti-aliasing and bitmap filtering when displaying bitmap subtitles
(
[
#6950
](
https://github.com/google/ExoPlayer/pull/6950
)
).
*
DRM:
*
DRM:
*
Add support for attaching DRM sessions to clear content in the demo app.
*
Add support for attaching DRM sessions to clear content in the demo app.
*
Remove
`DrmSessionManager`
references from all renderers.
*
Remove
`DrmSessionManager`
references from all renderers.
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitlePainter.java
View file @
6a36574a
...
@@ -65,7 +65,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -65,7 +65,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private
final
float
spacingAdd
;
private
final
float
spacingAdd
;
private
final
TextPaint
textPaint
;
private
final
TextPaint
textPaint
;
private
final
Paint
paint
;
private
final
Paint
windowPaint
;
private
final
Paint
bitmapPaint
;
// Previous input variables.
// Previous input variables.
@Nullable
private
CharSequence
cueText
;
@Nullable
private
CharSequence
cueText
;
...
@@ -124,9 +125,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -124,9 +125,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
textPaint
.
setAntiAlias
(
true
);
textPaint
.
setAntiAlias
(
true
);
textPaint
.
setSubpixelText
(
true
);
textPaint
.
setSubpixelText
(
true
);
paint
=
new
Paint
();
windowPaint
=
new
Paint
();
paint
.
setAntiAlias
(
true
);
windowPaint
.
setAntiAlias
(
true
);
paint
.
setStyle
(
Style
.
FILL
);
windowPaint
.
setStyle
(
Style
.
FILL
);
bitmapPaint
=
new
Paint
();
bitmapPaint
.
setAntiAlias
(
true
);
bitmapPaint
.
setFilterBitmap
(
true
);
}
}
/**
/**
...
@@ -442,9 +447,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -442,9 +447,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
canvas
.
translate
(
textLeft
,
textTop
);
canvas
.
translate
(
textLeft
,
textTop
);
if
(
Color
.
alpha
(
windowColor
)
>
0
)
{
if
(
Color
.
alpha
(
windowColor
)
>
0
)
{
p
aint
.
setColor
(
windowColor
);
windowP
aint
.
setColor
(
windowColor
);
canvas
.
drawRect
(
canvas
.
drawRect
(
-
textPaddingX
,
0
,
textLayout
.
getWidth
()
+
textPaddingX
,
textLayout
.
getHeight
(),
paint
);
-
textPaddingX
,
0
,
textLayout
.
getWidth
()
+
textPaddingX
,
textLayout
.
getHeight
(),
windowPaint
);
}
}
if
(
edgeType
==
CaptionStyleCompat
.
EDGE_TYPE_OUTLINE
)
{
if
(
edgeType
==
CaptionStyleCompat
.
EDGE_TYPE_OUTLINE
)
{
...
@@ -478,7 +487,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -478,7 +487,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@RequiresNonNull
({
"cueBitmap"
,
"bitmapRect"
})
@RequiresNonNull
({
"cueBitmap"
,
"bitmapRect"
})
private
void
drawBitmapLayout
(
Canvas
canvas
)
{
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