Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26e34d9d authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add getRawWidth() and getRawHeight()

Minor refactor to move the computation of raw width and raw height into
RawPointerAxes. This is needed because a future CL will use these
functions again.

Bug: 116239493
Test: atest inputflinger_tests
Change-Id: I25086f9ba370f9891851e87a2b2375af867409f3
parent 3af58850
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3480,8 +3480,8 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
    }

    // Raw width and height in the natural orientation.
    int32_t rawWidth = mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1;
    int32_t rawHeight = mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1;
    int32_t rawWidth = mRawPointerAxes.getRawWidth();
    int32_t rawHeight = mRawPointerAxes.getRawHeight();

    // Get associated display dimensions.
    DisplayViewport newViewport;
@@ -3913,8 +3913,8 @@ void TouchInputMapper::configureVirtualKeys() {

    int32_t touchScreenLeft = mRawPointerAxes.x.minValue;
    int32_t touchScreenTop = mRawPointerAxes.y.minValue;
    int32_t touchScreenWidth = mRawPointerAxes.x.maxValue - mRawPointerAxes.x.minValue + 1;
    int32_t touchScreenHeight = mRawPointerAxes.y.maxValue - mRawPointerAxes.y.minValue + 1;
    int32_t touchScreenWidth = mRawPointerAxes.getRawWidth();
    int32_t touchScreenHeight = mRawPointerAxes.getRawHeight();

    for (size_t i = 0; i < virtualKeyDefinitions.size(); i++) {
        const VirtualKeyDefinition& virtualKeyDefinition =
+2 −0
Original line number Diff line number Diff line
@@ -772,6 +772,8 @@ struct RawPointerAxes {
    RawAbsoluteAxisInfo slot;

    RawPointerAxes();
    inline int32_t getRawWidth() const { return x.maxValue - x.minValue + 1; }
    inline int32_t getRawHeight() const { return y.maxValue - y.minValue + 1; }
    void clear();
};