Closed Bug 1855573 Opened 8 months ago Closed 13 days ago

Allow an opaque compositor native surface to be topmost if nothing is overlaying it.

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Bug 1849680 forced all opaque compositor native surfaces to the bottom of the layer stack to allow content to be rendered on top. This is necessary for non-rectangular video surfaces, but is applied even for unmasked video, which doesn't require this layering. Unfortunately, forcing all video to the bottom layer prevents some useful optimizations such as:

  1. Native color layers in Bug 1731136
  2. macOS video low power mode in Bug 1653417

test_video_low_power_telemetry.html was disabled in Bug 1849680 for these reasons. This Bug covers the work to re-enable these optimizations and the test which confirms those optimizations are in place.

Using a native surface as an underlay blocks some optimizations, so we
want to do it only when required. This patch checks to ensure that we
only use a surface as an underlay if it is masked. The existing code
already ensured that only opaque surfaces could be underlays.

Blocks: 1872892

This is failing, at least in part, at least in some simple test cases, because of this check https://searchfox.org/mozilla-central/rev/9c65def36af441133c75a44b126e65184b039b2f/gfx/wr/webrender/src/picture.rs#2505 which is determining that the transform generated by SpaceMapper has an unexpected structure. When this check fails, the video is unable to be promoted to a surface and its frame contents are merged into the surrounding tiles. I'll try to get past this blocker.

The transform check is failing videos with metadata indicating that they are rotated. Not a common case, though important to fix. There's more to find here.

Attachment #9355442 - Attachment description: Bug 1855573 Part 1: Use native surfaces as underlays if they have masks and are opaque, overlays otherwise. → Bug 1855573 Part 1: Use native surfaces as underlays if they have masks, overlays otherwise.

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:bradwerth, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(gwatson)
Flags: needinfo?(bwerth)
Flags: needinfo?(gwatson)

Patches need rework and I'll mark them as such.

Flags: needinfo?(bwerth)
Blocks: 1883525
Blocks: wr-promotion
See Also: → 1891727
Blocks: HDR
Attachment #9355442 - Attachment description: Bug 1855573 Part 1: Use native surfaces as underlays if they have masks, overlays otherwise. → WIP: Bug 1855573 Part 1: Use native surfaces as underlays if they have masks, overlays otherwise.
Attachment #9355442 - Attachment description: WIP: Bug 1855573 Part 1: Use native surfaces as underlays if they have masks, overlays otherwise. → WIP: Bug 1855573 Part 1: Sometimes promote YUVImage surfaces as overlays.
Attachment #9355442 - Attachment description: WIP: Bug 1855573 Part 1: Sometimes promote YUVImage surfaces as overlays. → Bug 1855573 Part 1: Sometimes promote YUVImage surfaces as overlays.
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2418f8f766d4
Part 1: Sometimes promote YUVImage surfaces as overlays. r=gw
https://hg.mozilla.org/integration/autoland/rev/8fe75e83fbae
Part 2: Re-enable test_video_low_power_telemetry.html. r=gw
Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: