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

Commit a67cda6b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: Optimize region calculation for invisible layers."

parents 31b3a88f e5f4f694
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -871,6 +871,12 @@ void Layer::setVisibleNonTransparentRegion(const Region& setVisibleNonTransparen
    this->visibleNonTransparentRegion = setVisibleNonTransparentRegion;
}

void Layer::clearVisibilityRegions() {
    visibleRegion.clear();
    visibleNonTransparentRegion.clear();
    coveredRegion.clear();
}

// ----------------------------------------------------------------------------
// transaction
// ----------------------------------------------------------------------------
+5 −0
Original line number Diff line number Diff line
@@ -434,6 +434,11 @@ public:
     */
    void setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion);

    /*
     * Clear the visible, covered, and non-transparent regions.
     */
    void clearVisibilityRegions();

    /*
     * latchBuffer - called each time the screen is redrawn and returns whether
     * the visible regions need to be recomputed (this is a fairly heavy
+5 −0
Original line number Diff line number Diff line
@@ -2534,6 +2534,11 @@ void SurfaceFlinger::computeVisibleRegions(const sp<const DisplayDevice>& displa
            }
        }

        if (visibleRegion.isEmpty()) {
            layer->clearVisibilityRegions();
            return;
        }

        // Clip the covered region to the visible region
        coveredRegion = aboveCoveredLayers.intersect(visibleRegion);