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

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

Merge "InputMapper: pass RawEvent references instead of pointers" into main

parents a38ecacc a32a1198
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ std::list<NotifyArgs> InputDevice::process(const RawEvent* rawEvents, size_t cou
            mDropUntilNextSync = true;
        } else {
            for_each_mapper_in_subdevice(rawEvent->deviceId, [&](InputMapper& mapper) {
                out += mapper.process(rawEvent);
                out += mapper.process(*rawEvent);
            });
        }
        --count;
+6 −6
Original line number Diff line number Diff line
@@ -215,16 +215,16 @@ std::list<NotifyArgs> CursorInputMapper::reset(nsecs_t when) {
    return InputMapper::reset(when);
}

std::list<NotifyArgs> CursorInputMapper::process(const RawEvent* rawEvent) {
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) {
    if (rawEvent.type == EV_SYN && rawEvent.code == SYN_REPORT) {
        const auto [eventTime, readTime] =
                applyBluetoothTimestampSmoothening(getDeviceContext().getDeviceIdentifier(),
                                                   rawEvent->when, rawEvent->readTime,
                                                   rawEvent.when, rawEvent.readTime,
                                                   mLastEventTime);
        out += sync(eventTime, readTime);
        mLastEventTime = eventTime;
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public:
                                                    const InputReaderConfiguration& readerConfig,
                                                    ConfigurationChanges changes) override;
    [[nodiscard]] std::list<NotifyArgs> reset(nsecs_t when) override;
    [[nodiscard]] std::list<NotifyArgs> process(const RawEvent* rawEvent) override;
    [[nodiscard]] std::list<NotifyArgs> process(const RawEvent& rawEvent) override;

    virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t scanCode) override;

+5 −5
Original line number Diff line number Diff line
@@ -61,13 +61,13 @@ std::list<NotifyArgs> ExternalStylusInputMapper::reset(nsecs_t when) {
    return InputMapper::reset(when);
}

std::list<NotifyArgs> ExternalStylusInputMapper::process(const RawEvent* rawEvent) {
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);
    if (rawEvent.type == EV_SYN && rawEvent.code == SYN_REPORT) {
        out += sync(rawEvent.when);
    }
    return out;
}
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public:
                                                    const InputReaderConfiguration& config,
                                                    ConfigurationChanges changes) override;
    [[nodiscard]] std::list<NotifyArgs> reset(nsecs_t when) override;
    [[nodiscard]] std::list<NotifyArgs> process(const RawEvent* rawEvent) override;
    [[nodiscard]] std::list<NotifyArgs> process(const RawEvent& rawEvent) override;

private:
    SingleTouchMotionAccumulator mSingleTouchMotionAccumulator;
Loading