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
bb0a6415
authored
Jan 17, 2022
by
huangdarwin
Committed by
Ian Baker
Jan 25, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer GL: Add image diff in test.
PiperOrigin-RevId: 422392959
parent
41be22ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/FrameEditorDataProcessingTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/FrameEditorDataProcessingTest.java
View file @
bb0a6415
...
...
@@ -301,6 +301,10 @@ public final class FrameEditorDataProcessingTest {
assertThat
(
height
).
isEqualTo
(
expected
.
getHeight
());
assertThat
(
actual
.
getConfig
()).
isEqualTo
(
Bitmap
.
Config
.
ARGB_8888
);
long
sumMaximumAbsoluteDifferences
=
0
;
// Debug-only image diff without alpha. To use, set a breakpoint right before the method return
// to view the difference between the expected and actual bitmaps. A passing test should show
// an image that is completely black (color == 0).
Bitmap
debugDiff
=
Bitmap
.
createBitmap
(
width
,
height
,
Bitmap
.
Config
.
ARGB_8888
);
for
(
int
y
=
0
;
y
<
height
;
y
++)
{
for
(
int
x
=
0
;
x
<
width
;
x
++)
{
int
actualColor
=
actual
.
getPixel
(
x
,
y
);
...
...
@@ -310,6 +314,7 @@ public final class FrameEditorDataProcessingTest {
int
redDifference
=
abs
(
Color
.
red
(
actualColor
)
-
Color
.
red
(
expectedColor
));
int
blueDifference
=
abs
(
Color
.
blue
(
actualColor
)
-
Color
.
blue
(
expectedColor
));
int
greenDifference
=
abs
(
Color
.
green
(
actualColor
)
-
Color
.
green
(
expectedColor
));
debugDiff
.
setPixel
(
x
,
y
,
Color
.
rgb
(
redDifference
,
blueDifference
,
greenDifference
));
int
maximumAbsoluteDifference
=
0
;
maximumAbsoluteDifference
=
max
(
maximumAbsoluteDifference
,
alphaDifference
);
...
...
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