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

Commit 44edce91 authored by Evan Rosky's avatar Evan Rosky
Browse files

Parcel/Unparcel displaysize in InputWindowInfo

Somehow left this out causing compatraw to not work.

Also converted some float displaySize to int to match the
rest of displaySize uses.

Bug: 179274888
Test: atest libinput_tests:InputWindowInfo
Change-Id: I194f562e448d67d6fd8a04b86376e54c13933ae5
parent 8c68daf6
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -57,11 +57,12 @@ bool InputWindowInfo::operator==(const InputWindowInfo& info) const {
            info.frameLeft == frameLeft && info.frameTop == frameTop &&
            info.frameRight == frameRight && info.frameBottom == frameBottom &&
            info.surfaceInset == surfaceInset && info.globalScaleFactor == globalScaleFactor &&
            info.transform == transform && info.touchableRegion.hasSameRects(touchableRegion) &&
            info.visible == visible && info.trustedOverlay == trustedOverlay &&
            info.focusable == focusable && info.touchOcclusionMode == touchOcclusionMode &&
            info.hasWallpaper == hasWallpaper && info.paused == paused &&
            info.ownerPid == ownerPid && info.ownerUid == ownerUid &&
            info.transform == transform && info.displayWidth == displayWidth &&
            info.displayHeight == displayHeight &&
            info.touchableRegion.hasSameRects(touchableRegion) && info.visible == visible &&
            info.trustedOverlay == trustedOverlay && info.focusable == focusable &&
            info.touchOcclusionMode == touchOcclusionMode && info.hasWallpaper == hasWallpaper &&
            info.paused == paused && info.ownerPid == ownerPid && info.ownerUid == ownerUid &&
            info.packageName == packageName && info.inputFeatures == inputFeatures &&
            info.displayId == displayId && info.portalToDisplayId == portalToDisplayId &&
            info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop &&
@@ -99,6 +100,8 @@ status_t InputWindowInfo::writeToParcel(android::Parcel* parcel) const {
        parcel->writeFloat(transform.dtdy()) ?:
        parcel->writeFloat(transform.dsdy()) ?:
        parcel->writeFloat(transform.ty()) ?:
        parcel->writeInt32(displayWidth) ?:
        parcel->writeInt32(displayHeight) ?:
        parcel->writeBool(visible) ?:
        parcel->writeBool(focusable) ?:
        parcel->writeBool(hasWallpaper) ?:
@@ -153,6 +156,8 @@ status_t InputWindowInfo::readFromParcel(const android::Parcel* parcel) {
        parcel->readFloat(&dtdy) ?:
        parcel->readFloat(&dsdy) ?:
        parcel->readFloat(&ty) ?:
        parcel->readInt32(&displayWidth) ?:
        parcel->readInt32(&displayHeight) ?:
        parcel->readBool(&visible) ?:
        parcel->readBool(&focusable) ?:
        parcel->readBool(&hasWallpaper) ?:
+4 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ TEST(InputWindowInfo, Parcelling) {
    i.globalScaleFactor = 0.3;
    i.alpha = 0.7;
    i.transform.set({0.4, -1, 100, 0.5, 0, 40, 0, 0, 1});
    i.displayWidth = 1000;
    i.displayHeight = 2000;
    i.visible = false;
    i.focusable = false;
    i.hasWallpaper = false;
@@ -91,6 +93,8 @@ TEST(InputWindowInfo, Parcelling) {
    ASSERT_EQ(i.globalScaleFactor, i2.globalScaleFactor);
    ASSERT_EQ(i.alpha, i2.alpha);
    ASSERT_EQ(i.transform, i2.transform);
    ASSERT_EQ(i.displayWidth, i2.displayWidth);
    ASSERT_EQ(i.displayHeight, i2.displayHeight);
    ASSERT_EQ(i.visible, i2.visible);
    ASSERT_EQ(i.focusable, i2.focusable);
    ASSERT_EQ(i.hasWallpaper, i2.hasWallpaper);
+1 −1
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ std::string SensorEntry::getDescription() const {
volatile int32_t DispatchEntry::sNextSeqAtomic;

DispatchEntry::DispatchEntry(std::shared_ptr<EventEntry> eventEntry, int32_t targetFlags,
                             ui::Transform transform, float globalScaleFactor, vec2 displaySize)
                             ui::Transform transform, float globalScaleFactor, int2 displaySize)
      : seq(nextSeq()),
        eventEntry(std::move(eventEntry)),
        targetFlags(targetFlags),
+2 −2
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ struct DispatchEntry {
    int32_t targetFlags;
    ui::Transform transform;
    float globalScaleFactor;
    vec2 displaySize;
    int2 displaySize;
    // Both deliveryTime and timeoutTime are only populated when the entry is sent to the app,
    // and will be undefined before that.
    nsecs_t deliveryTime; // time when the event was actually delivered
@@ -228,7 +228,7 @@ struct DispatchEntry {
    int32_t resolvedFlags;

    DispatchEntry(std::shared_ptr<EventEntry> eventEntry, int32_t targetFlags,
                  ui::Transform transform, float globalScaleFactor, vec2 displaySize);
                  ui::Transform transform, float globalScaleFactor, int2 displaySize);

    inline bool hasForegroundTarget() const { return targetFlags & InputTarget::FLAG_FOREGROUND; }

+1 −1
Original line number Diff line number Diff line
@@ -2385,7 +2385,7 @@ void InputDispatcher::addWindowTargetLocked(const sp<InputWindowHandle>& windowH
        inputTarget.flags = targetFlags;
        inputTarget.globalScaleFactor = windowInfo->globalScaleFactor;
        inputTarget.displaySize =
                vec2(windowHandle->getInfo()->displayWidth, windowHandle->getInfo()->displayHeight);
                int2(windowHandle->getInfo()->displayWidth, windowHandle->getInfo()->displayHeight);
        inputTargets.push_back(inputTarget);
        it = inputTargets.end() - 1;
    }
Loading