-
Notifications
You must be signed in to change notification settings - Fork 6k
[iOS] Fix jitter keyboard animation by updating metrics value in onFrameRasterized callback. #41268
[iOS] Fix jitter keyboard animation by updating metrics value in onFrameRasterized callback. #41268
Conversation
…ameRasterized callback.
|
@cyanglaz Re: #41201 (comment) From the debugging this change does help with reducing jitter in keyboard animation. But I m not very sure current patch is correct and match the thought you mentioned in comment. Would you mind giving me some advice? ^_^ |
|
|
||
| flutter::Shell& shell = [_engine.get() shell]; | ||
| fml::closure onFrameRasterizedCallback = [&shell, platformTask] { | ||
| shell.GetTaskRunners().GetPlatformTaskRunner()->PostTask(platformTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this also needs to be synchronized. The rasterizer needs to wait until the platform task to finish before starting next frame.
| fml::closure onFrameRasterizedCallback = [&shell, platformTask] { | ||
| shell.GetTaskRunners().GetPlatformTaskRunner()->PostTask(platformTask); | ||
| }; | ||
| shell.AddOnFrameRasterizedCallback(onFrameRasterizedCallback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think add the callback here might be a frame late?
What I was thinking was the callback will be some sort of delegate method and runs every frame. The delegate then decide if the method body is a no-op (when there is no keyboard animation), or synchronously runs the keyboard animation on platform thread.
|
I made a patch to add callback in RPReplay_Final1681806613.MP4Seems has some delay with system's keyboard. Maybe we should still use vsync to track value so that we can get the correct presentation time by adding one frame interval time. As for #41201 |
|
Was the master updated meantime the fix is landed? Asking coz I updated to latest master and now keyboard has a bit different behaviour. I now see a delay (instead of the previous instant bump to end of run). Random jitters issue remained the same. Tested on iphone 13 pro ios 16.3.1 IMG_8947.MOV |
In Triage
Will add test and modify comments and code if this patch looks reasonable.
Pre-launch Checklist
///).