From 882bbf33a2d2d6a8a80d70721cb8e588dab5ea37 Mon Sep 17 00:00:00 2001 From: Philip Quinn Date: Wed, 26 Feb 2020 18:48:28 -0800 Subject: Swap video frame rotation direction. The DISPLAY_ORIENTATION_* values indicate the physical rotation of the display, and not the rotation of the graphics surface (see android.view.Display#getRotation()). To compensate for a physical rotation in one direction, the video frame needs to be rotated in the opposite direction. Bug: 150382187 Test: atest libinput_tests inputflinger_tests Change-Id: Iddd943c35084f7032a8e60273e5e63b59ad10d1c --- libs/input/TouchVideoFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/input/TouchVideoFrame.cpp') diff --git a/libs/input/TouchVideoFrame.cpp b/libs/input/TouchVideoFrame.cpp index 145b4ae03b..c62e0985f1 100644 --- a/libs/input/TouchVideoFrame.cpp +++ b/libs/input/TouchVideoFrame.cpp @@ -43,13 +43,13 @@ const struct timeval& TouchVideoFrame::getTimestamp() const { return mTimestamp; void TouchVideoFrame::rotate(int32_t orientation) { switch (orientation) { case DISPLAY_ORIENTATION_90: - rotateQuarterTurn(true /*clockwise*/); + rotateQuarterTurn(false /*clockwise*/); break; case DISPLAY_ORIENTATION_180: rotate180(); break; case DISPLAY_ORIENTATION_270: - rotateQuarterTurn(false /*clockwise*/); + rotateQuarterTurn(true /*clockwise*/); break; } } -- cgit v1.2.3-59-g8ed1b