Closed Bug 1667707 Opened 4 years ago Closed 4 years ago

Optimize clip image mask rendering for axis-aligned masks

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: gw, Assigned: gw)

References

Details

Attachments

(1 file)

No description provided.

There is some complexity in rendering clip masks that contain tiled
images, when the transform is complex (getting edge AA correct etc).
To work around this, the existing implementation simply draws the
entire primitive region with each image tile of the clip mask. This
works but is slow on large clip masks.

We can apply a simple optimization when the clip is axis-aligned,
which is the common case for the vast majority of pages. When this
case occurs, calculate a device space sub-rect for each of the
image mask tiles, and only draw to that part of the clip mask.

This can drastically reduce the amount of overdraw on pages that
have tiled clip masks that take up a large portion of the screen.
In the long term, WR should handle the case of complex transform

  • tiled clip masks better too.
Assignee: nobody → gwatson
Status: NEW → ASSIGNED
Blocks: 1663387
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dc423cb83ba6
Optimize clip image mask rendering for axis-aligned masks. r=jrmuizel

I had noticed and fixed this failure before landing, but had forgotten to push the updated patch to phabricator, sorry!

Hopefully the updated patch should land OK.

Flags: needinfo?(gwatson)
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2a8e77cf30b4
Optimize clip image mask rendering for axis-aligned masks. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Comment on attachment 9178135 [details]
Bug 1667707 - Optimize clip image mask rendering for axis-aligned masks.

Beta/Release Uplift Approval Request

  • User impact if declined: Slower performance when using WR on a number of pages than necessary.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch is very simple and should only affect a small number of pages. It's easy to disable / revert if it causes any problems.
  • String changes made/needed:
Attachment #9178135 - Flags: approval-mozilla-beta?
Regressions: 1667936

Please hold off on the beta merge request until I have time to investigate this reported regression in the morning. Jeff, do you want to back this out of nightly for now, until I investigate tomorrow?

Flags: needinfo?(jmuizelaar)
Attachment #9178135 - Flags: approval-mozilla-beta?
Status: RESOLVED → REOPENED
Flags: needinfo?(gwatson)
Resolution: FIXED → ---
Target Milestone: 83 Branch → ---

Updated the patch with a fix for the regression in #1667936, pending try is https://treeherder.mozilla.org/#/jobs?repo=try&revision=72347f1f5aa26f9bba45c67f87d91be9842a2e55

Flags: needinfo?(gwatson)
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9179a1a470a5
Optimize clip image mask rendering for axis-aligned masks. r=jrmuizel
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Flags: needinfo?(jmuizelaar)
Regressions: 1668004

Comment on attachment 9178135 [details]
Bug 1667707 - Optimize clip image mask rendering for axis-aligned masks.

Beta/Release Uplift Approval Request

  • User impact if declined: This is a very significant performance win on a range of pages (anything that uses a tiled clip mask + webrender) - on some pages it drops the GPU time to ~20% of what it was previously.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch has been in nightly for a around a week now, and doesn't seem to have caused any problems.
  • String changes made/needed:
Attachment #9178135 - Flags: approval-mozilla-beta?

Comment on attachment 9178135 [details]
Bug 1667707 - Optimize clip image mask rendering for axis-aligned masks.

we're about to build the 82 release candidate, and this doesn't appear to fix a regression, so I'd rather let it ride to 83.

Attachment #9178135 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: