-
Notifications
You must be signed in to change notification settings - Fork 6k
[Windows] Add callback for when the next frame is drawn #35408
Conversation
| // Pump messages for the Windows platform task runner. | ||
| ::MSG msg; | ||
| while (::GetMessage(&msg, nullptr, 0, 0)) { | ||
| ::TranslateMessage(&msg); | ||
| ::DispatchMessage(&msg); | ||
| } |
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.
This is necessary as otherwise platform tasks - including the next frame callback - won't run. The Windows platform thread's task runner is actually a window. It is woken up by posting a message to its window. If messages aren't dispatched, the Windows platform task runner is never woken up, and platform tasks are never executed.
yaakovschectman
left a comment
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.
LGTM
It looks the existing next frame callback handling that these changes utilize work by passing the callback around through several layers of abstraction (e.g. engine, embedder, delegate) before eventually ending up at the Rasterizer, am I understanding that right?
|
@yaakovschectman Yup that's correct. The full chain will be:
|
cbracken
left a comment
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.

Adds a Windows desktop API to be notified when the next frame has been drawn. In the future, this will be used by Windows app to hide the window until the first frame has been drawn. This effectively just exposes the corresponding API in
embedder.h.Follow up to: #35244
Part of flutter/flutter#41980
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.