-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add back synced frame method and use it for triggerRepaint. #4535
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4535 +/- ##
===========================================
- Coverage 91.95% 69.50% -22.45%
===========================================
Files 282 282
Lines 38908 38917 +9
Branches 6820 1321 -5499
===========================================
- Hits 35777 27049 -8728
- Misses 3003 11226 +8223
- Partials 128 642 +514 ☔ View full report in Codecov by Sentry. |
requestAnimationFrame is not a method that runs right away as far as I know, it might have higher priority than a promise, but I'm not sure I saw it anywhere, so I'm not sure I know how this fix will actually solve anything, but let me know if it does. In case this is not ready for review, please change it to a draft and ping me when you change it back to regular PR. THANKS! |
this experiment is not about the time between the call to requestAnimationFrame and when the passed callback is called, but about the time between the call to the passed callback and the actual map._render call. Currently the passed callback only schedules the _render and then returns whereas before the callback directly called _render.
|
Can we pass down the callback to the request animation frame and then call the resolve at the end? Would that work? Or is this the scratched out part in your comment? |
@xabbu42 what's the status of this PR? |
I still plan to finish this. There are uncaught exceptions during the unit tests which I still have to look into. Sidenote: I was lead quite astray because the exceptions from the unit tests also aborted the render tests when running |
|
I think the problem of the failing unit tests is more with the tests themself than a bug with this change. This as far as I got analyzing them:
The map state produced by this tests can not happen with normal usage, as setTerrain would not work with the empty style used for tests. Any pointers how this tests should be fixed? |
Looks like something is failing when the test harness is completing or something. |
Launch Checklist
An experimental fix for #4534. With this I can again a capture a single frame with spector.js, as all the rendering is directly done inside the requestAnimationFrame callback.
Unfortunatly tests dont run through but fail after some random point. Probably a race I introduced?