summaryrefslogtreecommitdiff
path: root/libs/input/InputWindow.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2020-07-01 15:53:47 -0700
committer chaviw <chaviw@google.com> 2020-07-21 11:26:55 -0700
commit1ff3d1e3cd851aff1e20fcb8958bbf3784d8f922 (patch)
tree931707079d6f4305e6fce7453c13d8d853386e06 /libs/input/InputWindow.cpp
parentdc07032296a6cd8525b5c7c1648ed7aed6f7769c (diff)
Use Transform in InputDispatcher
Modified InputDispatcher to use the Transform object instead of offset and scale values. Bug: 158476194 Test: /data/nativetest64/inputflinger_tests/inputflinger_tests Test: /data/nativetest64/libinput_tests/libinput_tests Change-Id: I31242fa6af92b02158ccb0d292c208a4a21c9e43
Diffstat (limited to 'libs/input/InputWindow.cpp')
-rw-r--r--libs/input/InputWindow.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/input/InputWindow.cpp b/libs/input/InputWindow.cpp
index 36c1f8068d..d5d35e6a96 100644
--- a/libs/input/InputWindow.cpp
+++ b/libs/input/InputWindow.cpp
@@ -57,7 +57,7 @@ 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.windowXScale == windowXScale && info.windowYScale == windowYScale &&
+ info.transform == transform &&
info.touchableRegion.hasSameRects(touchableRegion) && info.visible == visible &&
info.canReceiveKeys == canReceiveKeys && info.trustedOverlay == trustedOverlay &&
info.hasFocus == hasFocus && info.hasWallpaper == hasWallpaper &&
@@ -93,8 +93,12 @@ status_t InputWindowInfo::writeToParcel(android::Parcel* parcel) const {
parcel->writeInt32(frameBottom) ?:
parcel->writeInt32(surfaceInset) ?:
parcel->writeFloat(globalScaleFactor) ?:
- parcel->writeFloat(windowXScale) ?:
- parcel->writeFloat(windowYScale) ?:
+ parcel->writeFloat(transform.dsdx()) ?:
+ parcel->writeFloat(transform.dtdx()) ?:
+ parcel->writeFloat(transform.tx()) ?:
+ parcel->writeFloat(transform.dtdy()) ?:
+ parcel->writeFloat(transform.dsdy()) ?:
+ parcel->writeFloat(transform.ty()) ?:
parcel->writeBool(visible) ?:
parcel->writeBool(canReceiveKeys) ?:
parcel->writeBool(hasFocus) ?:
@@ -132,14 +136,19 @@ status_t InputWindowInfo::readFromParcel(const android::Parcel* parcel) {
flags = Flags<Flag>(parcel->readInt32());
type = static_cast<Type>(parcel->readInt32());
+ float dsdx, dtdx, tx, dtdy, dsdy, ty;
status = parcel->readInt32(&frameLeft) ?:
parcel->readInt32(&frameTop) ?:
parcel->readInt32(&frameRight) ?:
parcel->readInt32(&frameBottom) ?:
parcel->readInt32(&surfaceInset) ?:
parcel->readFloat(&globalScaleFactor) ?:
- parcel->readFloat(&windowXScale) ?:
- parcel->readFloat(&windowYScale) ?:
+ parcel->readFloat(&dsdx) ?:
+ parcel->readFloat(&dtdx) ?:
+ parcel->readFloat(&tx) ?:
+ parcel->readFloat(&dtdy) ?:
+ parcel->readFloat(&dsdy) ?:
+ parcel->readFloat(&ty) ?:
parcel->readBool(&visible) ?:
parcel->readBool(&canReceiveKeys) ?:
parcel->readBool(&hasFocus) ?:
@@ -165,6 +174,7 @@ status_t InputWindowInfo::readFromParcel(const android::Parcel* parcel) {
}
touchableRegionCropHandle = parcel->readStrongBinder();
+ transform.set(std::array<float, 9>{dsdx, dtdx, tx, dtdy, dsdy, ty, 0, 0, 1});
return OK;
}