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

Commit d9a25c40 authored by Arthur Hung's avatar Arthur Hung
Browse files

Reduce setInputWindows calls

The compare function 'Region::isTriviallyEqual' is just compare the
first iterator between two regions, and it will always get false if we
passed it from binder that would create a new one even they are equal.

That would cause the layer to recompute the visible regions and make
it direct to call 'updateInputWindowInfo' continually.

- Change to use Region::hasSameRects to reduce some unnecessary calls.

Bug: 133780957
Test: manual, open debug logs and watch a video
Change-Id: Ibc9c488c179b403b203a1853cd6f3be9bb23fbaa
parent 1d2d8b03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ bool LayerRejecter::reject(const sp<GraphicBuffer>& buf, const BufferItem& item)
    // We latch the transparent region here, instead of above where we latch
    // the rest of the geometry because it is only content but not necessarily
    // resize dependent.
    if (!mFront.activeTransparentRegion_legacy.isTriviallyEqual(
    if (!mFront.activeTransparentRegion_legacy.hasSameRects(
                mFront.requestedTransparentRegion_legacy)) {
        mFront.activeTransparentRegion_legacy = mFront.requestedTransparentRegion_legacy;