Closed Bug 1713686 Opened 1 year ago Closed 1 year ago

Reduce forced redraws in SW-WR/RenderCompositorSWGL on Wayland

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- wontfix
firefox92 --- fixed

People

(Reporter: rmader, Assigned: rmader)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files, 1 obsolete file)

IIUC similar to bug 1696101. Right now, at least on Linux, RenderCompositorOGLSWGL already reports significant less damage the system compositor compared to RenderCompositorSWGL. We should be able perform similarly.

Severity: -- → S3
Priority: -- → P3

So a bit of digging revealed that the culprit lies in this line: https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/render_backend.rs#1455-1458

should_redraw_on_invalidation is true for RenderCompositorSWGL but not for RenderCompositorOGLSWGL. Now I'll need to find out:

  • why should_redraw_on_invalidation is different
  • why invalidate_rendered_frame()[1] gets called in the first place (on both backends) and if that's a bug

1: https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/render_api.rs#376-378

Summary: Add partial rects handling to RenderCompositorSWGL → Reduce forced redraws in RenderCompositorSWGL

Turns out this a "regression" from bug 1690216 / https://phabricator.services.mozilla.com/D106246 - apparently the should_redraw_on_invalidation is necessary in some situations when the whole window gets unmapped on X11.

Unfortunately on sites like testufo.com we get a lot of invalidations from https://searchfox.org/mozilla-central/source/gfx/layers/wr/WebRenderBridgeParent.cpp#1469-1476.

Now I wonder if we should try to reduce the invalidations or rather limit should_redraw_on_invalidation to platforms that really need it (IIUC Wayland should not, while X11 might do).

Lee, as you wrote that patch, do you have any idea here?

Flags: needinfo?(lsalzman)
See Also: → 1690216

This was introduced in D106246, but it is not obvious that any
backend but X11 actually needs it. Notably the Wayland backend
most likely does not.

Removing it makes RenderCompositorSWGL behave (more) equally to
RenderCompositorOGLSWGL, massively reducing overpaint on certain
websites like testufo.com.

Assignee: nobody → robert.mader
Status: NEW → ASSIGNED
Attachment #9227700 - Attachment description: Bug 1713686 - Only set redraw_on_invalidation in RenderCompositorSWGL on X11, r=lsalzman,#gfx-reviewers → Bug 1713686 - Only set redraw_on_invalidation in RenderCompositorSWGL where needed, r=lsalzman,#gfx-reviewers
Flags: needinfo?(lsalzman)
Attachment #9227700 - Attachment description: Bug 1713686 - Only set redraw_on_invalidation in RenderCompositorSWGL where needed, r=lsalzman,#gfx-reviewers → Bug 1713686 - Disbale redraw_on_invalidation in RenderCompositorSWGL on Wayland, r=lsalzman,#gfx-reviewers
Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/d39eb2d0e9d8
Disbale redraw_on_invalidation in RenderCompositorSWGL on Wayland, r=lsalzman,gfx-reviewers
Blocks: wayland
Summary: Reduce forced redraws in RenderCompositorSWGL → Reduce forced redraws in SW-WR/RenderCompositorSWGL on Wayland
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
See Also: → 1708416
Regressions: 1717351

Dear sheriffs, please back out this patch from beta (91). For nightly/92 we have a fix, but it will need testing.

Flags: needinfo?(sheriffs)

Julien, Pascal, can you take the backout request for beta with the next batch of uplifts, please?

Flags: needinfo?(sheriffs)

Backed out changeset d39eb2d0e9d8 (bug 1713686) on beta for causing a regression (bug 1717351) a=backout
https://hg.mozilla.org/releases/mozilla-beta/rev/881ec252e382

Attachment #9227700 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.