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

Commit cbcaffc4 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: d6680c79

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

Change-Id: I33056cdb3bd9545f19a55921d7f83e8ca4c368e3
parents 72cb1fa0 d6680c79
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -2382,6 +2382,16 @@ void Layer::fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhy
    info.touchableRegion = inputTransform.transform(info.touchableRegion);
    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) {
InputWindowInfo Layer::fillInputInfo(const sp<DisplayDevice>& display) {
    if (!hasInputInfo()) {
    if (!hasInputInfo()) {
        mDrawingState.inputInfo.name = getName();
        mDrawingState.inputInfo.name = getName();
@@ -2419,6 +2429,7 @@ InputWindowInfo Layer::fillInputInfo(const sp<DisplayDevice>& display) {
    // anything.
    // anything.
    info.visible = hasInputInfo() ? canReceiveInput() : isVisible();
    info.visible = hasInputInfo() ? canReceiveInput() : isVisible();
    info.alpha = getAlpha();
    info.alpha = getAlpha();
    fillTouchOcclusionMode(info);


    auto cropLayer = mDrawingState.touchableRegionCrop.promote();
    auto cropLayer = mDrawingState.touchableRegionCrop.promote();
    if (info.replaceTouchableRegionWithCrop) {
    if (info.replaceTouchableRegionWithCrop) {
+4 −0
Original line number Original line Diff line number Diff line
@@ -1057,6 +1057,10 @@ private:
    // null.
    // null.
    sp<Layer> getRootLayer();
    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
    // Fills in the frame and transform info for the InputWindowInfo
    void fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhysicalDisplay);
    void fillInputFrameInfo(InputWindowInfo& info, const ui::Transform& toPhysicalDisplay);