From e07e103103d575789ad0a9d5a5212a000ad1f277 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 26 Nov 2018 12:55:53 -0800 Subject: SurfaceFlinger Input: Correct screen magnification. We need to pass the computed scaling factors through SurfaceFlinger as well as appropriately scaling the touchable region. We also need to be careful as to which axes we scale. In the past screen magnification has not lead to scaling of the TOUCH_MAJOR/MINOR axes, whereas whole-screen display compatibility scaling has. We preserve this behavior by differentiating between the global scale and a scale on any particular window. The window scale works like the global scale used to and the global scale is only used for additional scaling of the MAJOR/MINOR axes. Bug: 80101428 Bug: 113136004 Bug: 111440400 Change-Id: I97d809826f86b452f28443cb1046e8bfef1bbf9d --- libs/input/InputWindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/input/InputWindow.cpp') diff --git a/libs/input/InputWindow.cpp b/libs/input/InputWindow.cpp index e6bb255c74..556a005580 100644 --- a/libs/input/InputWindow.cpp +++ b/libs/input/InputWindow.cpp @@ -82,7 +82,9 @@ status_t InputWindowInfo::write(Parcel& output) const { output.writeInt32(frameRight); output.writeInt32(frameBottom); output.writeInt32(surfaceInset); - output.writeFloat(scaleFactor); + output.writeFloat(globalScaleFactor); + output.writeFloat(windowXScale); + output.writeFloat(windowYScale); output.writeBool(visible); output.writeBool(canReceiveKeys); output.writeBool(hasFocus); @@ -121,7 +123,9 @@ InputWindowInfo InputWindowInfo::read(const Parcel& from) { ret.frameRight = from.readInt32(); ret.frameBottom = from.readInt32(); ret.surfaceInset = from.readInt32(); - ret.scaleFactor = from.readFloat(); + ret.globalScaleFactor = from.readFloat(); + ret.windowXScale = from.readFloat(); + ret.windowYScale = from.readFloat(); ret.visible = from.readBool(); ret.canReceiveKeys = from.readBool(); ret.hasFocus = from.readBool(); -- cgit v1.2.3-59-g8ed1b