Loading core/java/android/view/MotionEvent.java +2 −0 Original line number Diff line number Diff line Loading @@ -2157,6 +2157,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { * MotionEvent. For touch events, clients can use this to determine if the * user's finger was touching the edge of the display. * * This property is only set for {@link #ACTION_DOWN} events. * * @see #EDGE_LEFT * @see #EDGE_TOP * @see #EDGE_RIGHT Loading services/input/EventHub.h +0 −2 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ struct RawAbsoluteAxisInfo { int32_t flat; // center flat position, eg. flat == 8 means center is between -8 and 8 int32_t fuzz; // error tolerance, eg. fuzz == 4 means value is +/- 4 due to noise inline int32_t getRange() const { return maxValue - minValue; } inline void clear() { valid = false; minValue = 0; Loading services/input/InputReader.cpp +138 −130 File changed.Preview size limit exceeded, changes collapsed. Show changes services/input/InputReader.h +0 −12 Original line number Diff line number Diff line Loading @@ -650,16 +650,6 @@ protected: // Immutable calibration parameters in parsed form. struct Calibration { // Position bool haveXOrigin; int32_t xOrigin; bool haveYOrigin; int32_t yOrigin; bool haveXScale; float xScale; bool haveYScale; float yScale; // Touch Size enum TouchSizeCalibration { TOUCH_SIZE_CALIBRATION_DEFAULT, Loading Loading @@ -756,11 +746,9 @@ protected: int32_t surfaceWidth, surfaceHeight; // Translation and scaling factors, orientation-independent. int32_t xOrigin; float xScale; float xPrecision; int32_t yOrigin; float yScale; float yPrecision; Loading services/input/PointerController.cpp +33 −28 Original line number Diff line number Diff line Loading @@ -109,12 +109,12 @@ bool PointerController::getBoundsLocked(float* outMinX, float* outMinY, switch (mLocked.displayOrientation) { case DISPLAY_ORIENTATION_90: case DISPLAY_ORIENTATION_270: *outMaxX = mLocked.displayHeight; *outMaxY = mLocked.displayWidth; *outMaxX = mLocked.displayHeight - 1; *outMaxY = mLocked.displayWidth - 1; break; default: *outMaxX = mLocked.displayWidth; *outMaxY = mLocked.displayHeight; *outMaxX = mLocked.displayWidth - 1; *outMaxY = mLocked.displayHeight - 1; break; } return true; Loading Loading @@ -309,48 +309,53 @@ void PointerController::setDisplayOrientation(int32_t orientation) { AutoMutex _l(mLock); if (mLocked.displayOrientation != orientation) { float absoluteX, absoluteY; // Map from oriented display coordinates to absolute display coordinates. // Apply offsets to convert from the pixel top-left corner position to the pixel center. // This creates an invariant frame of reference that we can easily rotate when // taking into account that the pointer may be located at fractional pixel offsets. float x = mLocked.pointerX + 0.5f; float y = mLocked.pointerY + 0.5f; float temp; // Undo the previous rotation. switch (mLocked.displayOrientation) { case DISPLAY_ORIENTATION_90: absoluteX = mLocked.displayWidth - mLocked.pointerY; absoluteY = mLocked.pointerX; temp = x; x = mLocked.displayWidth - y; y = temp; break; case DISPLAY_ORIENTATION_180: absoluteX = mLocked.displayWidth - mLocked.pointerX; absoluteY = mLocked.displayHeight - mLocked.pointerY; x = mLocked.displayWidth - x; y = mLocked.displayHeight - y; break; case DISPLAY_ORIENTATION_270: absoluteX = mLocked.pointerY; absoluteY = mLocked.displayHeight - mLocked.pointerX; break; default: absoluteX = mLocked.pointerX; absoluteY = mLocked.pointerY; temp = x; x = y; y = mLocked.displayHeight - temp; break; } // Map from absolute display coordinates to oriented display coordinates. // Perform the new rotation. switch (orientation) { case DISPLAY_ORIENTATION_90: mLocked.pointerX = absoluteY; mLocked.pointerY = mLocked.displayWidth - absoluteX; temp = x; x = y; y = mLocked.displayWidth - x; break; case DISPLAY_ORIENTATION_180: mLocked.pointerX = mLocked.displayWidth - absoluteX; mLocked.pointerY = mLocked.displayHeight - absoluteY; x = mLocked.displayWidth - x; y = mLocked.displayHeight - y; break; case DISPLAY_ORIENTATION_270: mLocked.pointerX = mLocked.displayHeight - absoluteY; mLocked.pointerY = absoluteX; break; default: mLocked.pointerX = absoluteX; mLocked.pointerY = absoluteY; temp = x; x = mLocked.displayHeight - y; y = temp; break; } // Apply offsets to convert from the pixel center to the pixel top-left corner position // and save the results. mLocked.pointerX = x - 0.5f; mLocked.pointerY = y - 0.5f; mLocked.displayOrientation = orientation; updateLocked(); Loading Loading
core/java/android/view/MotionEvent.java +2 −0 Original line number Diff line number Diff line Loading @@ -2157,6 +2157,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { * MotionEvent. For touch events, clients can use this to determine if the * user's finger was touching the edge of the display. * * This property is only set for {@link #ACTION_DOWN} events. * * @see #EDGE_LEFT * @see #EDGE_TOP * @see #EDGE_RIGHT Loading
services/input/EventHub.h +0 −2 Original line number Diff line number Diff line Loading @@ -85,8 +85,6 @@ struct RawAbsoluteAxisInfo { int32_t flat; // center flat position, eg. flat == 8 means center is between -8 and 8 int32_t fuzz; // error tolerance, eg. fuzz == 4 means value is +/- 4 due to noise inline int32_t getRange() const { return maxValue - minValue; } inline void clear() { valid = false; minValue = 0; Loading
services/input/InputReader.cpp +138 −130 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/input/InputReader.h +0 −12 Original line number Diff line number Diff line Loading @@ -650,16 +650,6 @@ protected: // Immutable calibration parameters in parsed form. struct Calibration { // Position bool haveXOrigin; int32_t xOrigin; bool haveYOrigin; int32_t yOrigin; bool haveXScale; float xScale; bool haveYScale; float yScale; // Touch Size enum TouchSizeCalibration { TOUCH_SIZE_CALIBRATION_DEFAULT, Loading Loading @@ -756,11 +746,9 @@ protected: int32_t surfaceWidth, surfaceHeight; // Translation and scaling factors, orientation-independent. int32_t xOrigin; float xScale; float xPrecision; int32_t yOrigin; float yScale; float yPrecision; Loading
services/input/PointerController.cpp +33 −28 Original line number Diff line number Diff line Loading @@ -109,12 +109,12 @@ bool PointerController::getBoundsLocked(float* outMinX, float* outMinY, switch (mLocked.displayOrientation) { case DISPLAY_ORIENTATION_90: case DISPLAY_ORIENTATION_270: *outMaxX = mLocked.displayHeight; *outMaxY = mLocked.displayWidth; *outMaxX = mLocked.displayHeight - 1; *outMaxY = mLocked.displayWidth - 1; break; default: *outMaxX = mLocked.displayWidth; *outMaxY = mLocked.displayHeight; *outMaxX = mLocked.displayWidth - 1; *outMaxY = mLocked.displayHeight - 1; break; } return true; Loading Loading @@ -309,48 +309,53 @@ void PointerController::setDisplayOrientation(int32_t orientation) { AutoMutex _l(mLock); if (mLocked.displayOrientation != orientation) { float absoluteX, absoluteY; // Map from oriented display coordinates to absolute display coordinates. // Apply offsets to convert from the pixel top-left corner position to the pixel center. // This creates an invariant frame of reference that we can easily rotate when // taking into account that the pointer may be located at fractional pixel offsets. float x = mLocked.pointerX + 0.5f; float y = mLocked.pointerY + 0.5f; float temp; // Undo the previous rotation. switch (mLocked.displayOrientation) { case DISPLAY_ORIENTATION_90: absoluteX = mLocked.displayWidth - mLocked.pointerY; absoluteY = mLocked.pointerX; temp = x; x = mLocked.displayWidth - y; y = temp; break; case DISPLAY_ORIENTATION_180: absoluteX = mLocked.displayWidth - mLocked.pointerX; absoluteY = mLocked.displayHeight - mLocked.pointerY; x = mLocked.displayWidth - x; y = mLocked.displayHeight - y; break; case DISPLAY_ORIENTATION_270: absoluteX = mLocked.pointerY; absoluteY = mLocked.displayHeight - mLocked.pointerX; break; default: absoluteX = mLocked.pointerX; absoluteY = mLocked.pointerY; temp = x; x = y; y = mLocked.displayHeight - temp; break; } // Map from absolute display coordinates to oriented display coordinates. // Perform the new rotation. switch (orientation) { case DISPLAY_ORIENTATION_90: mLocked.pointerX = absoluteY; mLocked.pointerY = mLocked.displayWidth - absoluteX; temp = x; x = y; y = mLocked.displayWidth - x; break; case DISPLAY_ORIENTATION_180: mLocked.pointerX = mLocked.displayWidth - absoluteX; mLocked.pointerY = mLocked.displayHeight - absoluteY; x = mLocked.displayWidth - x; y = mLocked.displayHeight - y; break; case DISPLAY_ORIENTATION_270: mLocked.pointerX = mLocked.displayHeight - absoluteY; mLocked.pointerY = absoluteX; break; default: mLocked.pointerX = absoluteX; mLocked.pointerY = absoluteY; temp = x; x = mLocked.displayHeight - y; y = temp; break; } // Apply offsets to convert from the pixel center to the pixel top-left corner position // and save the results. mLocked.pointerX = x - 0.5f; mLocked.pointerY = y - 0.5f; mLocked.displayOrientation = orientation; updateLocked(); Loading