Closed Bug 1574586 Opened 3 months ago Closed 2 months ago

Avoid refreshing the vibrancy on every composite by compositing into multiple framebuffers rather than sharing one framebuffer for the entire window between layers

Categories

(Core :: Graphics: Layers, enhancement)

All
macOS
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 4 obsolete files)

Even after bug 1491448, the window server still recomposites the entire window on every frame. If the window has parts that use vibrancy, such as the tab bar in the default theme, or the sidebar if it's open, then every composite causes the window server to recompute the vibrancy blur, even if only pixels outside the vibrancy have changed. This is expensive.

We should eliminate this full-window present so that content changes (such as website scrolling) do not cause the window server to composite the tab bar.

Background:
Bug 1491448 splits the window into opaque and non-opaque layers. However, the surface that we composite into still contains the entire window, and is used by all layers. So we need to refresh all layers on every composite, even if no pixels in some of those layers have changed. (If we don't refresh the layers, then they hold on to old surfaces in the swap chain and make the swap chain grow without bound.)
So rather than just having one surface that the compositor draws to, we need to create multiple surfaces for different parts of the window and teach the compositor to draw to multiple native layers through repeated compositing.

Depends on: 1574592
Depends on: 1574745
Attachment #9086253 - Attachment description: Bug 1574586 - Change the coordinate space of CalculateScissorRect and DrawGeometry's aClipRect. → Bug 1574745 - Change the coordinate space of CalculateScissorRect and DrawGeometry's aClipRect.

Try build for testing: target.dmg

Type: task → enhancement

This means that when something changes in an opaque layer, the window server
only needs to copy the opaque layer to the screen and can avoid recomputing any
window backgrounds for transparent parts of the window. This can save power,
especially when transparent parts of the window use the macOS vibrancy effect,
which requires the window server to compute a blur.

Depends on D43879

Attachment #9088922 - Attachment description: Bug 1574586 - Create separate NativeLayer objects for opaque and transparent parts of the window, and do multi-pass composites to draw their contents. → Bug 1574586 - Create separate NativeLayer objects for opaque and transparent parts of the window, and do one composite each to draw their contents. r=mattwoodrow
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/9798d276348f
Create separate NativeLayer objects for opaque and transparent parts of the window, and do one composite each to draw their contents. r=mattwoodrow
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.