Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e5f4f694 authored by Robert Carr's avatar Robert Carr
Browse files

SurfaceFlinger: Optimize region calculation for invisible layers.

This CL causes the computeVisibleRegions codepath to escape earlier
for a given layer when it is found that it's visible region is empty.
All the juggling in the later part of the function can end up being
quite expensive even when it's no-op. It seems this is largely due
to allocation of storage space for temporary Region variables. In particular
I found that without this CL Walleye was uncapable of staying in 60fps mode
when there were 100 fully occluded layers and 1 visible layer. With this CL
we're able to stay in 60FPS. We are running in to this issue in some practical
cases where we can have a few dozen parent layers with no buffer adding a lot
of time to computeVisibleRegion. Since they have no mActiveBuffer they will
bail early from isVisible and benefit from this change.

Test: Manual. Existing tests pass.
Change-Id: I7dd39f8641649a3cc38b4ed017ffe9b6eefcf224
parent c4257d27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment