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

Commit 7d46353c authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Ensure visible regions are recomputed when children change."

parents 09071edf 1323c952
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1106,6 +1106,11 @@ uint32_t Layer::doTransaction(uint32_t flags) {
        mNeedsFiltering = (!getActiveTransform(c).preserveRects() || type >= ui::Transform::SCALE);
    }

    if (mChildrenChanged) {
        flags |= eVisibleRegion;
        mChildrenChanged = false;
    }

    // If the layer is hidden, signal and clear out all local sync points so
    // that transactions for layers depending on this layer's frames becoming
    // visible are not blocked
@@ -1628,13 +1633,16 @@ size_t Layer::getChildrenCount() const {
}

void Layer::addChild(const sp<Layer>& layer) {
    mChildrenChanged = true;

    mCurrentChildren.add(layer);
    layer->setParent(this);
}

ssize_t Layer::removeChild(const sp<Layer>& layer) {
    layer->setParent(nullptr);
    mChildrenChanged = true;

    layer->setParent(nullptr);
    return mCurrentChildren.remove(layer);
}

+2 −0
Original line number Diff line number Diff line
@@ -849,6 +849,8 @@ protected:

    // Can only be accessed with the SF state lock held.
    bool mLayerDetached{false};
    // Can only be accessed with the SF state lock held.
    bool mChildrenChanged{false};

private:
    /**