Title: [279480] trunk/Source/WebCore
Revision
279480
Author
beid...@apple.com
Date
2021-07-01 13:22:16 -0700 (Thu, 01 Jul 2021)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279479 => 279480)


--- trunk/Source/WebCore/ChangeLog	2021-07-01 20:22:09 UTC (rev 279479)
+++ trunk/Source/WebCore/ChangeLog	2021-07-01 20:22:16 UTC (rev 279480)
@@ -1,3 +1,32 @@
+2021-07-01  Brady Eidson  <beid...@apple.com>
+
+        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:
+
 2021-07-01  Dean Jackson  <d...@apple.com>
 
         Add a layoutTrait for an additional controls scale factor

Modified: trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm (279479 => 279480)


--- trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm	2021-07-01 20:22:09 UTC (rev 279479)
+++ trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm	2021-07-01 20:22:16 UTC (rev 279480)
@@ -68,7 +68,7 @@
 
 #endif // !HAVE(GCCONTROLLER_HID_DEVICE_CHECK)
 
-static const Seconds inputNotificationDelay { 16_ms };
+static const Seconds inputNotificationDelay { 1_ms };
 
 GameControllerGamepadProvider& GameControllerGamepadProvider::singleton()
 {

Modified: trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm (279479 => 279480)


--- trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm	2021-07-01 20:22:09 UTC (rev 279479)
+++ trunk/Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm	2021-07-01 20:22:16 UTC (rev 279480)
@@ -43,7 +43,7 @@
 namespace WebCore {
 
 static const Seconds connectionDelayInterval { 500_ms };
-static const Seconds hidInputNotificationDelay { 50_ms };
+static const Seconds hidInputNotificationDelay { 1_ms };
 
 static RetainPtr<CFDictionaryRef> deviceMatchingDictionary(uint32_t usagePage, uint32_t usage)
 {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to