New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 848097 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocked on:
issue 865346



Sign in to add a comment

Add pixel tests for Overlay/Underlay/DirectComposition path on Windows wherever supported

Project Member Reported by zmo@chromium.org, May 31 2018

Issue description

For now, the Windows Intel bots are able to support overlays, so at least we can test the code path on that config.

A few scenarios we want to test:

1) Verify the overlay path works. We probably don't need to worry if it's promoted to hardware overlay or not, as far as we go down the promoting to overlay path. So this is just playing a video and verify some pixels from a frame.

2) Verify the underlay path works. Underlay isn't enabled by default. But protected videos will force this to be enabled. We can't verify the pixels of protected videos, but we can test with a regular video, but a flag to force underlay, and verify the path works and pixels are rendered correctly.

3) Verify the non-root RenderPass case also works. This also requires a flag to force the path, and with a carefully constructed test case to trigger the non-root RenderPass. We need to verify also that the non-root RenderPass is actually created (because it may change in the future), so we are sure this path is tested.
 

Comment 1 by zmo@chromium.org, May 31 2018

Look at content/test/gpu/gpu_tests/pixel_integration_test.py for examples.

Run it with:

content/test/gpu/run_gpu_integrated_test.py pixel --browser=release
Note: There are some pixel "unit" tests in direct_composition_surface_win_unittest.cc, but those only test the GPU process logic.

Comment 3 by kbr@chromium.org, May 31 2018

Note also that we can add more APIs to https://cs.chromium.org/chromium/src/content/renderer/gpu/gpu_benchmarking_extension.h and .cc. The pixel tests can access these APIs from JavaScript. For example, we could expose an API which could return whether the layer associated with the video element went down the path to promote it to an overlay, and the test could be constructed to fail if not.

I have created a video FourColors.mp4 for those tests. This video has 4 color blocks (yellow, red, green and blue) and it looks like a still image.

To make this video, I first created a .png file from Windows Paint.exe. This FourColors.png file had the 4 colors I wanted to test. Then I used the Mac App iStopMotion to insert FourColors.png to every frame of the video. Twelve frames would make a one-second video. The total length of this video was 2 seconds. Then it was exported as a H.264 (960x540) mp4 video.

With this video, these pixel tests can be done by comparing the (Y, R, G, B) solid color of the output images.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/03f164d32108bb3bcef218581dcd59bb8b8d9cb8

commit 03f164d32108bb3bcef218581dcd59bb8b8d9cb8
Author: Maggie Chen <magchen@chromium.org>
Date: Thu Jul 19 01:07:08 2018

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: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576296}
[modify] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/chrome/test/BUILD.gn
[add] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/content/test/data/gpu/pixel_video_complex_overlays.html
[add] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/content/test/data/gpu/pixel_video_nonroot.html
[add] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/content/test/data/gpu/pixel_video_underlay.html
[modify] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/media/test/data/README
[add] https://crrev.com/03f164d32108bb3bcef218581dcd59bb8b8d9cb8/media/test/data/four-colors.mp4

Blockedon: 865346
Status: Fixed (was: Assigned)

Sign in to add a comment