Loading include/input/Input.h +0 −5 Original line number Diff line number Diff line Loading @@ -201,11 +201,6 @@ namespace android { class Parcel; #endif /* * Apply the given transform to the point without applying any translation/offset. */ vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy); const char* inputEventTypeToString(int32_t type); std::string inputEventSourceToString(int32_t source); Loading libs/input/Input.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ float transformAngle(const ui::Transform& transform, float angleRadians) { return atan2f(transformedPoint.x, -transformedPoint.y); } vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy) { const vec2 transformedXy = transform.transform(xy); const vec2 transformedOrigin = transform.transform(0, 0); return transformedXy - transformedOrigin; } bool shouldDisregardTransformation(uint32_t source) { // Do not apply any transformations to axes from joysticks or touchpads. return isFromSource(source, AINPUT_SOURCE_CLASS_JOYSTICK) || Loading Loading @@ -114,12 +120,6 @@ int32_t IdGenerator::nextId() const { // --- InputEvent --- vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy) { const vec2 transformedXy = transform.transform(xy); const vec2 transformedOrigin = transform.transform(0, 0); return transformedXy - transformedOrigin; } const char* inputEventTypeToString(int32_t type) { switch (type) { case AINPUT_EVENT_TYPE_KEY: { Loading services/inputflinger/include/PointerControllerInterface.h +1 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,7 @@ namespace android { * fingers * * The pointer controller is responsible for providing synchronization and for tracking * display orientation changes if needed. It works in the display panel's coordinate space, which * is the same coordinate space used by InputReader. * display orientation changes if needed. */ class PointerControllerInterface { protected: Loading services/inputflinger/reader/mapper/CursorInputMapper.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -188,6 +188,8 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* if (!changes || (changes & InputReaderConfiguration::CHANGE_DISPLAY_INFO)) { mOrientation = DISPLAY_ORIENTATION_0; mDisplayWidth = 0; mDisplayHeight = 0; const bool isOrientedDevice = (mParameters.orientationAware && mParameters.hasAssociatedDisplay); Loading @@ -201,6 +203,8 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* config->getDisplayViewportByType(ViewportType::INTERNAL); if (internalViewport) { mOrientation = getInverseRotation(internalViewport->orientation); mDisplayWidth = internalViewport->deviceWidth; mDisplayHeight = internalViewport->deviceHeight; } } Loading Loading @@ -331,7 +335,14 @@ void CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) { mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (moved) { mPointerController->move(deltaX, deltaY); float dx = deltaX; float dy = deltaY; // Rotate the delta from InputReader's un-rotated coordinate space to // PointerController's rotated coordinate space that is oriented with the // viewport. rotateDelta(getInverseRotation(mOrientation), &dx, &dy); mPointerController->move(dx, dy); } if (buttonsChanged) { Loading @@ -342,6 +353,10 @@ void CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) { } mPointerController->getPosition(&xCursorPosition, &yCursorPosition); // Rotate the cursor position that is in PointerController's rotated coordinate space // to InputReader's un-rotated coordinate space. rotatePoint(mOrientation, xCursorPosition /*byRef*/, yCursorPosition /*byRef*/, mDisplayWidth, mDisplayHeight); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_X, xCursorPosition); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, yCursorPosition); Loading services/inputflinger/reader/mapper/CursorInputMapper.h +2 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,8 @@ private: VelocityControl mWheelYVelocityControl; int32_t mOrientation; int32_t mDisplayWidth; int32_t mDisplayHeight; std::shared_ptr<PointerControllerInterface> mPointerController; Loading Loading
include/input/Input.h +0 −5 Original line number Diff line number Diff line Loading @@ -201,11 +201,6 @@ namespace android { class Parcel; #endif /* * Apply the given transform to the point without applying any translation/offset. */ vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy); const char* inputEventTypeToString(int32_t type); std::string inputEventSourceToString(int32_t source); Loading
libs/input/Input.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ float transformAngle(const ui::Transform& transform, float angleRadians) { return atan2f(transformedPoint.x, -transformedPoint.y); } vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy) { const vec2 transformedXy = transform.transform(xy); const vec2 transformedOrigin = transform.transform(0, 0); return transformedXy - transformedOrigin; } bool shouldDisregardTransformation(uint32_t source) { // Do not apply any transformations to axes from joysticks or touchpads. return isFromSource(source, AINPUT_SOURCE_CLASS_JOYSTICK) || Loading Loading @@ -114,12 +120,6 @@ int32_t IdGenerator::nextId() const { // --- InputEvent --- vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy) { const vec2 transformedXy = transform.transform(xy); const vec2 transformedOrigin = transform.transform(0, 0); return transformedXy - transformedOrigin; } const char* inputEventTypeToString(int32_t type) { switch (type) { case AINPUT_EVENT_TYPE_KEY: { Loading
services/inputflinger/include/PointerControllerInterface.h +1 −2 Original line number Diff line number Diff line Loading @@ -30,8 +30,7 @@ namespace android { * fingers * * The pointer controller is responsible for providing synchronization and for tracking * display orientation changes if needed. It works in the display panel's coordinate space, which * is the same coordinate space used by InputReader. * display orientation changes if needed. */ class PointerControllerInterface { protected: Loading
services/inputflinger/reader/mapper/CursorInputMapper.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -188,6 +188,8 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* if (!changes || (changes & InputReaderConfiguration::CHANGE_DISPLAY_INFO)) { mOrientation = DISPLAY_ORIENTATION_0; mDisplayWidth = 0; mDisplayHeight = 0; const bool isOrientedDevice = (mParameters.orientationAware && mParameters.hasAssociatedDisplay); Loading @@ -201,6 +203,8 @@ void CursorInputMapper::configure(nsecs_t when, const InputReaderConfiguration* config->getDisplayViewportByType(ViewportType::INTERNAL); if (internalViewport) { mOrientation = getInverseRotation(internalViewport->orientation); mDisplayWidth = internalViewport->deviceWidth; mDisplayHeight = internalViewport->deviceHeight; } } Loading Loading @@ -331,7 +335,14 @@ void CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) { mPointerController->setPresentation(PointerControllerInterface::Presentation::POINTER); if (moved) { mPointerController->move(deltaX, deltaY); float dx = deltaX; float dy = deltaY; // Rotate the delta from InputReader's un-rotated coordinate space to // PointerController's rotated coordinate space that is oriented with the // viewport. rotateDelta(getInverseRotation(mOrientation), &dx, &dy); mPointerController->move(dx, dy); } if (buttonsChanged) { Loading @@ -342,6 +353,10 @@ void CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) { } mPointerController->getPosition(&xCursorPosition, &yCursorPosition); // Rotate the cursor position that is in PointerController's rotated coordinate space // to InputReader's un-rotated coordinate space. rotatePoint(mOrientation, xCursorPosition /*byRef*/, yCursorPosition /*byRef*/, mDisplayWidth, mDisplayHeight); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_X, xCursorPosition); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, yCursorPosition); Loading
services/inputflinger/reader/mapper/CursorInputMapper.h +2 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,8 @@ private: VelocityControl mWheelYVelocityControl; int32_t mOrientation; int32_t mDisplayWidth; int32_t mDisplayHeight; std::shared_ptr<PointerControllerInterface> mPointerController; Loading