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
ccdb3b70
authored
Feb 14, 2023
by
huangdarwin
Committed by
christosts
Feb 14, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Effect: Add leading zero to decimals in floats.
PiperOrigin-RevId: 509518734
parent
b18dccde
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java
library/effect/src/test/java/com/google/android/exoplayer2/effect/CropTest.java
library/effect/src/test/java/com/google/android/exoplayer2/effect/ScaleToFitTransformationTest.java
library/effect/src/androidTest/java/com/google/android/exoplayer2/effect/CropPixelTest.java
View file @
ccdb3b70
...
...
@@ -116,7 +116,7 @@ public final class CropPixelTest {
public
void
drawFrame_cropSmaller_matchesGoldenFile
()
throws
Exception
{
String
testId
=
"drawFrame_cropSmaller"
;
cropShaderProgram
=
new
Crop
(
/* left= */
-
.
9
f
,
/* right= */
.
1
f
,
/* bottom= */
-
1
f
,
/* top= */
.
5
f
)
new
Crop
(
/* left= */
-
0.9f
,
/* right= */
0.1f
,
/* bottom= */
-
1
f
,
/* top= */
0
.5f
)
.
toGlShaderProgram
(
context
,
/* useHdr= */
false
);
Size
outputSize
=
cropShaderProgram
.
configure
(
inputWidth
,
inputHeight
);
setupOutputTexture
(
outputSize
.
getWidth
(),
outputSize
.
getHeight
());
...
...
library/effect/src/test/java/com/google/android/exoplayer2/effect/CropTest.java
View file @
ccdb3b70
...
...
@@ -48,9 +48,9 @@ public final class CropTest {
public
void
configure_setCrop_changesDimensions
()
{
int
inputWidth
=
300
;
int
inputHeight
=
200
;
float
left
=
-.
5
f
;
float
right
=
.
5
f
;
float
bottom
=
.
5
f
;
float
left
=
-
0
.5f
;
float
right
=
0
.5f
;
float
bottom
=
0
.5f
;
float
top
=
1
f
;
Crop
crop
=
new
Crop
(
left
,
right
,
bottom
,
top
);
...
...
library/effect/src/test/java/com/google/android/exoplayer2/effect/ScaleToFitTransformationTest.java
View file @
ccdb3b70
...
...
@@ -52,14 +52,14 @@ public final class ScaleToFitTransformationTest {
int
inputHeight
=
150
;
ScaleToFitTransformation
scaleToFitTransformation
=
new
ScaleToFitTransformation
.
Builder
()
.
setScale
(
/* scaleX= */
.
5
f
,
/* scaleY= */
1
f
)
.
setScale
(
/* scaleX= */
0
.5f
,
/* scaleY= */
1
f
)
.
build
();
Size
outputSize
=
scaleToFitTransformation
.
configure
(
inputWidth
,
inputHeight
);
boolean
isNoOp
=
scaleToFitTransformation
.
isNoOp
(
inputWidth
,
inputHeight
);
assertThat
(
isNoOp
).
isFalse
();
assertThat
(
outputSize
.
getWidth
()).
isEqualTo
(
Math
.
round
(
inputWidth
*
.
5
f
));
assertThat
(
outputSize
.
getWidth
()).
isEqualTo
(
Math
.
round
(
inputWidth
*
0
.5f
));
assertThat
(
outputSize
.
getHeight
()).
isEqualTo
(
inputHeight
);
}
...
...
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