Closed Bug 1607846 Opened 5 years ago Closed 5 years ago

Applying outline-style: auto to a large number of elements makes WR scrolling unusable

Categories

(Core :: Graphics: WebRender, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(2 files)

STR:

  • Enable layout.css.outline-style-auto.enabled (or wait for bug 1031664 to be landed, which I plan to do not long from now).
  • Apply this rule to any page with the inspector: * { outline: 1px auto }.
  • Try to scroll.

ER:

  • Scrolling is somewhat usable.

AR:

  • WebRender becomes terribly slow, to the point you can't scroll.

Here's a profile of scrolling on this page which shows the 500ms+ CONTENT_FRAME_TIMEs: https://perfht.ml/39TkeEE

It seems we spend a bunch of time waiting on the GPU process, but not doing much?

It's unclear to me what is the GPU process waiting for... Nical, am I missing any thread in the profiler or something?

Flags: needinfo?(nical.bugzilla)

Can you add WrWorker to the list of threads?

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Yeah. It looks like we're spending all of our time in memmove. We seem to be recording theme bitmaps into blobs and then the recording is just memoving out of them or something like that. We're supposed to avoid recording widget drawing as blobs. Perhaps that's not happening here.

https://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderCommandBuilder.cpp#2093

Are the outlines nsDisplayThemedBackground or nsDisplayButtonBorder?

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Conceptually they're very similar to nsDisplayThemedBackground though, I guess.

Should I just override that to return true and see how it looks like?

It does work much better indeed.

Assignee: nobody → emilio

Similar to how we paint themed borders and backgrounds.

Attachment #9119526 - Attachment description: Bug 1607846 - Make WebRender pain themed outlines in the content process. r=jrmuizel → Bug 1607846 - Make WebRender paint themed outlines in the content process. r=jrmuizel
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/47d6ea69c274 Make WebRender paint themed outlines in the content process. r=jrmuizel
Flags: needinfo?(nical.bugzilla)

This is a pre-requisite cleanup, as the FrameLayerBuilder code ends up calling
this unconditionally, and thus the assertion on the other patch can end up
failing. Hopefully it's dead code, though, so no big deal.

Tweak the WebRender code to avoid two virtual calls in the common path, too.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e87b85be662d Cleanup a bit usage of MustPaintOnContentSide(). r=jrmuizel
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/adeaa48edc50 Make WebRender paint themed outlines in the content process. r=jrmuizel
Flags: needinfo?(emilio)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
QA Whiteboard: [qa-74b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: