Changeset 279480 in webkit


Ignore:
Timestamp:
Jul 1, 2021, 1:22:16 PM (4 years ago)
Author:
beidson@apple.com
Message:

HIDGamepadProvider adds an extra 50ms to all inputs
<rdar://70315838> and https://bugs.webkit.org/show_bug.cgi?id=217742

Reviewed by Alex Christensen.

No new tests.
Tried to write an API test to drive inputs in the delay range, but that was way too fragile
on a local developer machine, much less a bot that's under load.

These input delays were an early best-effort to get input to line up with RaF, which the spec
mentions as a goal.

Not sure how 50 slipped in for HID, vs the 16 on GCF.

Whether or not lining up perfectly with RaF is actually a useful goal, in the meantime driving
input as quickly as possible seems much more desirable.

We still want to coalesce multiple close together inputs into 1 logical event to smooth out jitter
with certain devices, and reduce IPC and DOM object churn during rapid input (or with buggy devices).

In testing with what I have on my desk, using a true 0-delay timer for that was not desirable.

But 1ms seems peachy keen.

  • platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
  • platform/gamepad/mac/HIDGamepadProvider.mm:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r279478 r279480  
     12021-07-01  Brady Eidson  <beidson@apple.com>
     2
     3        HIDGamepadProvider adds an extra 50ms to all inputs
     4        <rdar://70315838> and https://bugs.webkit.org/show_bug.cgi?id=217742
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests.
     9        Tried to write an API test to drive inputs in the delay range, but that was way too fragile
     10        on a local developer machine, much less a bot that's under load.
     11
     12        These input delays were an early best-effort to get input to line up with RaF, which the spec
     13        mentions as a goal.
     14       
     15        Not sure how 50 slipped in for HID, vs the 16 on GCF.
     16       
     17        Whether or not lining up perfectly with RaF is actually a useful goal, in the meantime driving
     18        input as quickly as possible seems much more desirable.
     19       
     20        We still want to coalesce multiple close together inputs into 1 logical event to smooth out jitter
     21        with certain devices, and reduce IPC and DOM object churn during rapid input (or with buggy devices).
     22       
     23        In testing with what I have on my desk, using a true 0-delay timer for that was not desirable.
     24
     25        But 1ms seems peachy keen.
     26       
     27        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
     28        * platform/gamepad/mac/HIDGamepadProvider.mm:
     29
    1302021-07-01  Dean Jackson  <dino@apple.com>
    231
  • trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm

    r276880 r279480  
    6969#endif // !HAVE(GCCONTROLLER_HID_DEVICE_CHECK)
    7070
    71 static const Seconds inputNotificationDelay { 16_ms };
     71static const Seconds inputNotificationDelay { 1_ms };
    7272
    7373GameControllerGamepadProvider& GameControllerGamepadProvider::singleton()
  • trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm

    r267241 r279480  
    4444
    4545static const Seconds connectionDelayInterval { 500_ms };
    46 static const Seconds hidInputNotificationDelay { 50_ms };
     46static const Seconds hidInputNotificationDelay { 1_ms };
    4747
    4848static RetainPtr<CFDictionaryRef> deviceMatchingDictionary(uint32_t usagePage, uint32_t usage)
Note: See TracChangeset for help on using the changeset viewer.