Closed Bug 1523882 Opened 5 years ago Closed 5 years ago

Rework snapping logic in clip mask generate to fix uneven box shadows

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: gw, Assigned: gw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The existing logic for handling clip mask generation is inaccurate for primitives that are snapped. This can result in uneven stretching and rendering of box shadows, among other issues.

Instead, calculate the snap offsets for a primitive where appropriate on the CPU, and pass these to the clip mask shaders. This allows the clip mask shaders to undo the effect of snapping, which produces accurate and symmetrical box shadows.

Assignee: nobody → gwatson
Blocks: 1411693
Blocks: 1475827

This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1475827 and https://bugzilla.mozilla.org/show_bug.cgi?id=1411693.

The most notable part is the new reftest output in scale.png, showing symmetrical box shadows at various transform scales, with/without clipping and segmentation.

The try run [1] looks mostly good, it has:

  • A few additional PASS results that I need to update (in addition to the new PASSes and a couple of extra fuzzy tests I already annotated).
  • A perma-fail in Wr3 for a known intermittent. I need to investigate this further in the morning to see what is causing this.
  • Some unrelated intermittents.

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=84d30b68e3ac146199272ec85fa99cbc15b4132a

Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/25ca68e7836e
Rework snapping logic in clip mask generate to fix uneven box shadows. r=kvark,nical
Backout by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c016d35d0f53
Backed out changeset 25ca68e7836e for wrench bustages on boxshadow-spread-only-ref.png. CLOSED TREE
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/86daa5d406b6
Rework snapping logic in clip mask generate to fix uneven box shadows. r=kvark,nical
Backout by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/964b59c9d7a5
Backed out changeset 86daa5d406b6 for wrench bustage in reftests/boxshadow/box-shadow-huge-radius.png CLOSED TREE

It looks like that test is slightly fuzzy on CI (max difference: 1, number of differing pixels: 5). I've marked that wrench test with fuzziness, and will try to push again.

Flags: needinfo?(gwatson)
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e6f1ffb7119f
Rework snapping logic in clip mask generate to fix uneven box shadows. r=kvark,nical
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

This is, somehow, causing a major performance regression in GPU time. It seems to be resulting in either many more clip masks, or much larger ones. I've asked the sheriffs to back it out for now, and will debug and re-land tomorrow.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla67 → ---
Backout by nerli@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/200859112d0d
Backed out changeset e6f1ffb7119f per dev's request for causing major perf regression a=backout
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/43d250c96e71
Rework snapping logic in clip mask generate to fix uneven box shadows. r=kvark,nical
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

== Change summary for alert #19153 (as of Tue, 05 Feb 2019 07:42:14 GMT) ==

Improvements:

2% ts_paint linux64-qr opt e10s stylo 862.08 -> 848.58
1% sessionrestore linux64-qr opt e10s stylo 799.67 -> 789.33

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=19153

Regressions: 1543601
Regressions: 1691766
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: