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

Commit 771c0c6f authored by Bernardo Rufino's avatar Bernardo Rufino Committed by Automerger Merge Worker
Browse files

Merge "Inherit touch occlusion mode from parent w/ input info" into sc-dev am:...

Merge "Inherit touch occlusion mode from parent w/ input info" into sc-dev am: d6680c79 am: 9225150b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14937186

Change-Id: Ie21c314a76bae2c5432f7fdb0b5b7d3b2f8b59a2
parents cdec5168 9225150b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2382,6 +2382,16 @@ void Layer::fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhy
    info.touchableRegion = inputTransform.transform(info.touchableRegion);
}

void Layer::fillTouchOcclusionMode(InputWindowInfo& info) {
    sp<Layer> p = this;
    while (p != nullptr && !p->hasInputInfo()) {
        p = p->mDrawingParent.promote();
    }
    if (p != nullptr) {
        info.touchOcclusionMode = p->mDrawingState.inputInfo.touchOcclusionMode;
    }
}

InputWindowInfo Layer::fillInputInfo(const sp<DisplayDevice>& display) {
    if (!hasInputInfo()) {
        mDrawingState.inputInfo.name = getName();
@@ -2419,6 +2429,7 @@ InputWindowInfo Layer::fillInputInfo(const sp<DisplayDevice>& display) {
    // anything.
    info.visible = hasInputInfo() ? canReceiveInput() : isVisible();
    info.alpha = getAlpha();
    fillTouchOcclusionMode(info);

    auto cropLayer = mDrawingState.touchableRegionCrop.promote();
    if (info.replaceTouchableRegionWithCrop) {
+4 −0
Original line number Diff line number Diff line
@@ -1057,6 +1057,10 @@ private:
    // null.
    sp<Layer> getRootLayer();

    // Fills in the touch occlusion mode of the first parent (including this layer) that
    // hasInputInfo() or no-op if no such parent is found.
    void fillTouchOcclusionMode(InputWindowInfo& info);

    // Fills in the frame and transform info for the InputWindowInfo
    void fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhysicalDisplay);