Closed Bug 1491451 Opened 6 years ago Closed 5 years ago

When using the CoreAnimation present path, make CompositorOGL use a scissor rect to only update the parts of the framebuffer that have changed

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox64 --- wontfix
firefox70 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

At the moment, CompositorOGL always composites the entire window, no matter how much has actually changed.
LayerManagerCompositor already computes the changed region of the window, but we currently don't make use of that information on macOS, for two reasons:
 - We don't have an API to tell the window server which parts of the screen have changed.
 - We don't want to use the scissor rect to change only parts of the default framebuffer because our OpenGLContext is double buffered, and so the scissor rect computation would need to be aware of the number of buffers, which is brittle.

When using the CoreAnimation present path, we draw into an offscreen frame buffer. We have the full control over how to single buffer or double buffer, so we can be sure that we can compute a correct update rect for the frame buffer. Thus, the second point from above no longer applies.
So we should make use of the invalid region that LayerManagerComposite computes in order to save power when drawing into the default frame buffer.

Note that this still doesn't allow us to tell the system which parts of the screen need to be recomposited by the window server. But at least it saves some power in our side of the pipeline.
Priority: -- → P3
Whiteboard: [gfx-noted]
Depends on: 1574592
Blocks: 1574745
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Blocks: 1576499
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/cbbae09aa554
Limit CompositorOGL drawing to the invalid rect. r=mattwoodrow
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

== Change summary for alert #22939 (as of Tue, 03 Sep 2019 09:46:59 GMT) ==

Improvements:

9% raptor-tp6-slides-firefox loadtime macosx1014-64-shippable opt 1,521.79 -> 1,386.08
9% raptor-tp6-slides-firefox loadtime macosx1014-64-shippable opt 1,521.52 -> 1,391.38

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

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

Attachment

General

Created:
Updated:
Size: