Commit 03f164d3 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Add Underlay/Nonroot/Transformation DirectComposition pixel tests on Windows.

Three more cases are added to the Direct Composition Pixel tests.
Pixel_DirectComposition_Underlay test is created by adding a black block
on top of a video.
Pixel_DirectComposition_Nonroot test is created by adding a white gradient
blending effect on a video.
Pixel_DirectComposition_ComplexOverlays test is created by applying scaleX,
scaleY and rotate.

The H.264 mp4 video clip FourColors.mp4 used in these tests is created by
Maggie Chen. The video frames has 4 color blocks (Yellow, Red, Green, Blue)
and it looks like a still image. With this video, the pixel tests can be
done by solid color block comparisons. No golden images are needed.

Bug:848097

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I95483ba8c96c495b1150c749f1f55243c6a5efa5
Reviewed-on: https://chromium-review.googlesource.com/1136003
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576296}
parent 12daa3ac
......@@ -334,6 +334,7 @@ group("telemetry_gpu_integration_test") {
# For pixel_test
"//media/test/data/bear.mp4",
"//media/test/data/bear-vp9.webm",
"//media/test/data/four-colors.mp4",
]
}
......
<!DOCTYPE HTML>
<!-- READ BEFORE UPDATING:
If this test is updated make sure to increment the "revision" value of the
associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
that the baseline images are regenerated on the next run.
-->
<html>
<head>
<title>Complex Overlay Video test</title>
<style type="text/css">
.nomargin {
margin: 0px auto;
}
.transformed {
transform: scaleX(1.5);
transform: scaleY(1.5);
transform: rotate(20deg);
}
</style>
<script>
var g_swapsBeforeAck = 15;
var video;
function main()
{
video = document.getElementById("video");
if (video.readyState >= 4) {
waitForFinish();
} else {
video.addEventListener('canplaythrough', waitForFinish, true);
}
}
function waitForFinish()
{
if (g_swapsBeforeAck == 0) {
domAutomationController.send("SUCCESS");
} else {
g_swapsBeforeAck--;
window.requestAnimationFrame(waitForFinish);
}
}
</script>
</head>
<body onload="main()">
<div id="container" style="position:absolute; top:0px; left:0px;">
<video class="nomargin transformed" id="video" width="240" height="136">
<source src="/media/test/data/four-colors.mp4" type="video/mp4">
</video>
</div>
<div id="container" class="nomargin" style="position:absolute; top:0px; left:0px; width:30px; height:30px; background-color:black;">
</div>
</body>
</html>
<!DOCTYPE HTML>
<!-- READ BEFORE UPDATING:
If this test is updated make sure to increment the "revision" value of the
associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
that the baseline images are regenerated on the next run.
-->
<html>
<head>
<title>Nonroot Video test</title>
<style type="text/css">
.nomargin {
margin: 0px auto;
}
.gradient {
-webkit-mask-image: -webkit-gradient(
linear, left 50%, right 50%,
color-stop(0.00, rgba(0,0,0,1)),
color-stop(0.75, rgba(0,0,0,1)),
color-stop(0.80, rgba(0,0,0,0)),
color-stop(1.00, rgba(0,0,0,0)));
}
</style>
<script>
var g_swapsBeforeAck = 15;
var video;
function main()
{
video = document.getElementById("video");
if (video.readyState >= 4) {
waitForFinish();
} else {
video.addEventListener('canplaythrough', waitForFinish, true);
}
}
function waitForFinish()
{
if (g_swapsBeforeAck == 0) {
domAutomationController.send("SUCCESS");
} else {
g_swapsBeforeAck--;
window.requestAnimationFrame(waitForFinish);
}
}
</script>
</head>
<body onload="main()">
<div id="container" style="position:absolute; top:0px; left:0px;">
<video class="nomargin gradient" id="video" width="240" height="136">
<source src="/media/test/data/four-colors.mp4" type="video/mp4">
</video>
</div>
<div id="container" class="nomargin" style="position:absolute; top:0px; left:0px; width:30px; height:30px; background-color:black;">
</div>
</body>
</html>
<!DOCTYPE HTML>
<!-- READ BEFORE UPDATING:
If this test is updated make sure to increment the "revision" value of the
associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
that the baseline images are regenerated on the next run.
-->
<html>
<head>
<title>Underlay Video test</title>
<style type="text/css">
.nomargin {
margin: 0px auto;
}
</style>
<script>
var g_swapsBeforeAck = 15;
var video;
function main()
{
video = document.getElementById("video");
if (video.readyState >= 4) {
waitForFinish();
} else {
video.addEventListener('canplaythrough', waitForFinish, true);
}
}
function waitForFinish()
{
if (g_swapsBeforeAck == 0) {
domAutomationController.send("SUCCESS");
} else {
g_swapsBeforeAck--;
window.requestAnimationFrame(waitForFinish);
}
}
</script>
</head>
<body onload="main()">
<div id="container" style="position:absolute; top:0px; left:0px">
<video class="nomargin" id="video" width="240" height="136">
<source src="/media/test/data/four-colors.mp4" type="video/mp4">
</video>
</div>
<div id="container" class="nomargin" style="position:absolute; top:0px; left:0px; width:30px; height:30px; background-color:black;">
</div>
</body>
</html>
......@@ -699,6 +699,15 @@ def MacSpecificPages(base_name):
def DirectCompositionPages(base_name):
browser_args = ['--enable-direct-composition-layers']
browser_args_Underlay = browser_args + [
'--enable-features=DirectCompositionUnderlays']
browser_args_Nonroot = browser_args +[
'--enable-features=DirectCompositionNonrootOverlays,' +
'DirectCompositionUnderlays']
browser_args_Complex = browser_args + [
'--enable-features=DirectCompositionComplexOverlays,' +
'DirectCompositionNonrootOverlays,' +
'DirectCompositionUnderlays']
return [
PixelTestPage(
'pixel_video_mp4.html',
......@@ -713,4 +722,136 @@ def DirectCompositionPages(base_name):
test_rect=[0, 0, 300, 300],
revision=9,
browser_args=browser_args),
]
PixelTestPage(
'pixel_video_underlay.html',
base_name + '_DirectComposition_Underlay',
test_rect=[0, 0, 240, 136],
revision=0, # Golden image revision is not used
browser_args=browser_args_Underlay,
expected_colors=[
{
'comment': 'black top left',
'location': [4, 4],
'size': [20, 20],
'color': [0, 0, 0],
'tolerance': 3
},
{
'comment': 'yellow top left quadrant',
'location': [4, 34],
'size': [110, 30],
'color': [255, 255, 15],
'tolerance': 3
},
{
'comment': 'red top right quadrant',
'location': [124, 4],
'size': [110, 60],
'color': [255, 17, 24],
'tolerance': 3
},
{
'comment': 'blue bottom left quadrant',
'location': [4, 72],
'size': [110, 60],
'color': [12, 12, 255],
'tolerance': 3
},
{
'comment': 'green bottom right quadrant',
'location': [124, 72],
'size': [110, 60],
'color': [44, 255, 16],
'tolerance': 3
}
]),
PixelTestPage(
'pixel_video_nonroot.html',
base_name + '_DirectComposition_Nonroot',
test_rect=[0, 0, 240, 136],
revision=0, # Golden image revision is not used
browser_args=browser_args_Nonroot,
expected_colors=[
{
'comment': 'black top left',
'location': [4, 4],
'size': [20, 20],
'color': [0, 0, 0],
'tolerance': 3
},
{
'comment': 'yellow top left quadrant',
'location': [4, 34],
'size': [110, 30],
'color': [255, 255, 15],
'tolerance': 3
},
{
'comment': 'red top right quadrant',
'location': [124, 4],
'size': [110, 60],
'color': [255, 17, 24],
'tolerance': 3
},
{
'comment': 'blue bottom left quadrant',
'location': [4, 72],
'size': [110, 60],
'color': [12, 12, 255],
'tolerance': 3
},
{
'comment': 'green bottom right quadrant',
'location': [124, 72],
'size': [110, 60],
'color': [44, 255, 16],
'tolerance': 3
}
]),
PixelTestPage(
'pixel_video_complex_overlays.html',
base_name + '_DirectComposition_ComplexOverlays',
test_rect=[0, 0, 240, 136],
revision=0, # Golden image revision is not used
browser_args=browser_args_Complex,
expected_colors=[
{
'comment': 'black top left',
'location': [4, 4],
'size': [20, 20],
'color': [0, 0, 0],
'tolerance': 3
},
{
'comment': 'yellow top left quadrant',
'location': [60, 10],
'size': [65, 30],
'color': [255, 255, 15],
'tolerance': 3
},
{
'comment': 'red top right quadrant',
'location': [150, 45],
'size': [65, 30],
'color': [255, 17, 24],
'tolerance': 3
},
{
'comment': 'blue bottom left quadrant',
'location': [30, 70],
'size': [65, 30],
'color': [12, 12, 255],
'tolerance': 3
},
{
'comment': 'green bottom right quadrant',
'location': [130, 100],
'size': [65, 30],
'color': [44, 255, 16],
'tolerance': 3
}
]),
]
......@@ -44,6 +44,7 @@ nonzero-start-time.webm - Has the same headers as bear-320x240.webm but the firs
bear-320x240_corrupted_after_init_segment.webm - bear-320x240.webm's initialization segment followed by "CORRUPTED\n"
bear-320x240-live.webm - bear-320x240.webm remuxed w/o a duration and using clusters with unknown sizes.
ffmpeg -i bear-320x240.webm -acodec copy -vcodec copy -f webm pipe:1 > bear-320x240-live.webm
four-colors.mp4 - H.264 960x540, 4 color blocks (Y,R,G,B) in the image. Has the same image for every frame.
vp8-I-frame-160x240 - The first I frame of a 160x240 reencode of bear-320x240.webm.
vp8-I-frame-320x120 - The first I frame of a 320x120 reencode of bear-320x240.webm.
vp8-I-frame-320x240 - The first I frame of bear-320x240.webm.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment