Closed Bug 1472733 Opened 6 years ago Closed 6 years ago

Layer invalidation problems with CSS transforms

Categories

(Core :: Web Painting, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: mikokm, Assigned: mikokm)

References

Details

Attachments

(2 files)

Bug 1345891 introduced fixes to integer overflows during layer tree invalidation. Unfortunately, these changes regressed https://keithclark.co.uk/labs/css-fps/nojs/ pretty badly, at least on macOS.
It's a trainwreck on Win10 as well. *Really* slow and lots of invalidation issues.
Priority: -- → P2
Status: NEW → ASSIGNED
At least one part of the problem here is that nsRegion can store areas beyond of what can be presented with nsRect, that is returned by nsRegion::GetBounds(). This overflow can happen when computing shadow visible regions for layers that do not use intermediate surfaces[1].

[1]: https://searchfox.org/mozilla-central/source/gfx/layers/composite/LayerManagerComposite.cpp#1462
Depends on: 1480832
Attached file testcase.html
The changes by bug 1480832 fixed the flickering during shadow visible region overflows.

The layer tree invalidation still seems to have problems, as shown by the attached testcase: there are obvious pauses during the rotation, especially when the rotation angle is near 90 degrees. The transform is smooth if composition is forced for every frame by commenting out the early return from LayerManagerComposite::UpdateAndRender()[1].

There is also some flickering, exactly two times per rotation, which might or might not be a related problem.

[1]: https://searchfox.org/mozilla-central/rev/2466b82b729765fb0a3ab62f812c1a96a7362478/gfx/layers/composite/LayerManagerComposite.cpp#527
Comment on attachment 9005079 [details]
Bug 1472733 - Improve IntRect overflow handling when calculating layer invalidation area and visible region

Matt Woodrow (:mattwoodrow) has approved the revision.
Attachment #9005079 - Flags: review+
Pushed by mikokm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6ba3579108f3
Improve IntRect overflow handling when calculating layer invalidation area and visible region r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/6ba3579108f3
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Out of interest, was this mean to apply with WebRender on? Because both the attached testcase and the keithclark.co.uk link are still a mess on latest Nightly, macOS 10.12, 2017 Macbook Pro 15".
(In reply to Robin Whittleton from comment #9)
> Out of interest, was this mean to apply with WebRender on? Because both the
> attached testcase and the keithclark.co.uk link are still a mess on latest
> Nightly, macOS 10.12, 2017 Macbook Pro 15".

No, this patch fixed problems with layers that webrender is not using. I have updated the title to clarify this.
Summary: Invalidation problems with CSS transforms → Layer invalidation problems with CSS transforms
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: