Closed Bug 1731136 Opened 3 years ago Closed 2 years ago

WebRender should use one large tile for flat color fills in native layers

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

Details

Attachments

(5 files, 1 obsolete file)

Bug 1653417 created a heuristic to detect a case when a video power optimization is possible. This heuristic would be greatly simplified or even eliminated if WebRender consistently used a single large native layer to represent a flat color fill (as opposed to a patchwork of memory-optimized tiles).

See Also: → 1591540
Blocks: 1731821
Attachment #9243816 - Attachment description: WIP: Bug 1731136 Part 1: Allow native compositors to handle flat colors as surfaces. → WIP: Bug 1731136 Part 2: Allow native compositors to handle surface backdrops.
Attachment #9243817 - Attachment is obsolete: true
Attachment #9245360 - Attachment description: WIP: Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. → Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces.
Attachment #9243816 - Attachment description: WIP: Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. → Bug 1731136 Part 2: Allow native compositors to handle surface backdrops.
Attachment #9245361 - Attachment description: WIP: Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces. → Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces.
Attachment #9246053 - Attachment description: WIP: Bug 1731136 Part 4: Make NativeLayerCA handle backdrop layers. → Bug 1731136 Part 4: Make NativeLayerCA handle backdrop layers.
Attachment #9246053 - Attachment description: Bug 1731136 Part 4: Make NativeLayerCA handle backdrop layers. → Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers.
Attachment #9245361 - Attachment description: Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces. → WIP: Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces.
Attachment #9246053 - Attachment description: Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers. → WIP: Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers.
Attachment #9245360 - Attachment description: Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. → WIP: Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces.
Attachment #9243816 - Attachment description: Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. → WIP: Bug 1731136 Part 2: Allow native compositors to handle surface backdrops.
Attachment #9245360 - Attachment description: WIP: Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces. → Bug 1731136 Part 1: Extend compositor to manage backdrop surfaces.
Attachment #9243816 - Attachment description: WIP: Bug 1731136 Part 2: Allow native compositors to handle surface backdrops. → Bug 1731136 Part 2: Allow native compositors to handle surface backdrops.
Attachment #9245361 - Attachment description: WIP: Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces. → Bug 1731136 Part 3: Make the tile_cache track compositor backdrop surfaces.
Attachment #9246053 - Attachment description: WIP: Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers. → Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers.
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b408a3230170
Part 1: Extend compositor to manage backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/7afa3f4b5a85
Part 2: Allow native compositors to handle surface backdrops. r=gw
https://hg.mozilla.org/integration/autoland/rev/6b5b4b5eb1e9
Part 3: Make the tile_cache track compositor backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/c333a19d8712
Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers. r=mstange
Regressions: 1771465
Regressions: 1771459

Backed out for causing Bug 1771465 . CLOSED TREE (backed out on dev's request )

Backout link : https://hg.mozilla.org/integration/autoland/rev/ef61304adce38b3bb51466dc4585b2e3d08c4093

Status: RESOLVED → REOPENED
Flags: needinfo?(bwerth)
Resolution: FIXED → ---
Target Milestone: 102 Branch → ---

I've updated D128131 to fix the issue noted in Bug 1771465. I'll wait to re-land the patches until after the merge date.

Flags: needinfo?(bwerth)

This calculates the visible area of the TileCache, and compares against that area
for three purposes:

  1. Backdrops must cover only the visible area, not the tile coverage area.
  2. Primitives only obstruct the backdrop if they appear in the visible area.
  3. Backdrop candidates opaque rects are clipped to the visible area.

All these changes ensure that if a tile coverage area is larger than the window,
backdrops are only considered and created for the visible area.

Attachment #9246053 - Attachment description: Bug 1731136 Part 4: Make macOS native compositor and NativeLayerCA handle backdrop layers. → Bug 1731136 Part 5: Make macOS native compositor and NativeLayerCA handle backdrop
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6b5626a7b82d
Part 1: Extend compositor to manage backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/7dfdcb74d1c1
Part 2: Allow native compositors to handle surface backdrops. r=gw
https://hg.mozilla.org/integration/autoland/rev/e127e41e12da
Part 3: Make the tile_cache track compositor backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/a24467137e9b
Part 4: Limit backdrops to the visible area. r=gw
https://hg.mozilla.org/integration/autoland/rev/d2a56d51c65b
Part 5: Make macOS native compositor and NativeLayerCA handle backdrop r=mstange

Backed out 5 changesets (bug 1731136) for causing reftest failures in layout/reftests/bugs/299136-1.html

Backout link: https://hg.mozilla.org/integration/autoland/rev/47b031489c06cd0c1f48652c4d6d262d400218eb

Push with failures

Failure log

Flags: needinfo?(bwerth)

This is a surprising failure, with test layout/reftests/bugs/299136-1.html on Windows software WebRender. The failure appears to be in differences in text anti-aliasing. When I run the test locally on macOS, it passes. When I manually load the test page and the ref page, neither of them actually invoke a native color layer. The only changed code that could be getting run on Windows is in D128131 where the empty tile rects are not sent to the compositor. I'm surprised this would make a difference since it is intended to only be an optimization.

I'll run a general try run of all the reftests and see what I can replicate on treeherder. Depending on how widespread these failures are, the fix will either be an update to test expectations, or to remove the "optimization" of omitting empty tile rects in cases where the native color layers won't be used anyway.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=d74eb0203332e3ee09ea6107a34c0f2f4feea305

Flags: needinfo?(bwerth)

(In reply to Brad Werth [:bradwerth] from comment #15)

This is a surprising failure, with test layout/reftests/bugs/299136-1.html on Windows software WebRender. The failure appears to be in differences in text anti-aliasing.

Specifically, the difference is in whether or not the text is eligible for subpixel-AA. With the patches applied, the test file is eligible and the ref file is not. I'm not sure which of the two is changed by the patches. My guess is that we want both to be eligible and the patches have made the ref file ineligible somehow. This doesn't appear to be tied to software WebRender.

New theory, with these code changes calculate_subpixel_mode is checking a slightly smaller backdrop.opaque_rect that doesn't completely cover the tiling area, and so it doesn't turn on subpixel mode for the text. This should be fixable by making the comparison only check against the visible portion of the tiling area.

Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9de0a9fc0a0e
Part 1: Extend compositor to manage backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/215d2e4b1833
Part 2: Allow native compositors to handle surface backdrops. r=gw
https://hg.mozilla.org/integration/autoland/rev/05d7f11bf1c9
Part 3: Make the tile_cache track compositor backdrop surfaces. r=gw
https://hg.mozilla.org/integration/autoland/rev/06c57c0af21d
Part 4: Limit backdrops to the visible area. r=gw
https://hg.mozilla.org/integration/autoland/rev/ebe5a430029f
Part 5: Make macOS native compositor and NativeLayerCA handle backdrop r=mstange
Regressions: 1772713
Regressions: 1772867
Regressions: 1773064
Blocks: 1773109
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: