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

Commit 69ca5af9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "input accumulators: pass RawEvent references instead of pointers" into main

parents 3cb24e3d 71953c2b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -155,8 +155,8 @@ std::list<NotifyArgs> CapturedTouchpadEventConverter::process(const RawEvent& ra
        mMotionAccumulator.finishSync();
    }

    mCursorButtonAccumulator.process(&rawEvent);
    mMotionAccumulator.process(&rawEvent);
    mCursorButtonAccumulator.process(rawEvent);
    mMotionAccumulator.process(rawEvent);
    return out;
}

+8 −8
Original line number Diff line number Diff line
@@ -55,14 +55,14 @@ void CursorMotionAccumulator::clearRelativeAxes() {
    mRelY = 0;
}

void CursorMotionAccumulator::process(const RawEvent* rawEvent) {
    if (rawEvent->type == EV_REL) {
        switch (rawEvent->code) {
void CursorMotionAccumulator::process(const RawEvent& rawEvent) {
    if (rawEvent.type == EV_REL) {
        switch (rawEvent.code) {
            case REL_X:
                mRelX = rawEvent->value;
                mRelX = rawEvent.value;
                break;
            case REL_Y:
                mRelY = rawEvent->value;
                mRelY = rawEvent.value;
                break;
        }
    }
@@ -217,9 +217,9 @@ std::list<NotifyArgs> CursorInputMapper::reset(nsecs_t when) {

std::list<NotifyArgs> CursorInputMapper::process(const RawEvent* rawEvent) {
    std::list<NotifyArgs> out;
    mCursorButtonAccumulator.process(rawEvent);
    mCursorMotionAccumulator.process(rawEvent);
    mCursorScrollAccumulator.process(rawEvent);
    mCursorButtonAccumulator.process(*rawEvent);
    mCursorMotionAccumulator.process(*rawEvent);
    mCursorScrollAccumulator.process(*rawEvent);

    if (rawEvent->type == EV_SYN && rawEvent->code == SYN_REPORT) {
        const auto [eventTime, readTime] =
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public:
    CursorMotionAccumulator();
    void reset(InputDeviceContext& deviceContext);

    void process(const RawEvent* rawEvent);
    void process(const RawEvent& rawEvent);
    void finishSync();

    inline int32_t getRelativeX() const { return mRelX; }
+2 −2
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@ std::list<NotifyArgs> ExternalStylusInputMapper::reset(nsecs_t when) {

std::list<NotifyArgs> ExternalStylusInputMapper::process(const RawEvent* rawEvent) {
    std::list<NotifyArgs> out;
    mSingleTouchMotionAccumulator.process(rawEvent);
    mTouchButtonAccumulator.process(rawEvent);
    mSingleTouchMotionAccumulator.process(*rawEvent);
    mTouchButtonAccumulator.process(*rawEvent);

    if (rawEvent->type == EV_SYN && rawEvent->code == SYN_REPORT) {
        out += sync(rawEvent->when);
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ std::list<NotifyArgs> MultiTouchInputMapper::reset(nsecs_t when) {
std::list<NotifyArgs> MultiTouchInputMapper::process(const RawEvent* rawEvent) {
    std::list<NotifyArgs> out = TouchInputMapper::process(rawEvent);

    mMultiTouchMotionAccumulator.process(rawEvent);
    mMultiTouchMotionAccumulator.process(*rawEvent);
    return out;
}

Loading