Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc
- index b6b55df11..2a21d3fd9 100644
- --- a/shell/common/vsync_waiter.cc
- +++ b/shell/common/vsync_waiter.cc
- @@ -28,9 +28,23 @@ VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners)
- VsyncWaiter::~VsyncWaiter() = default;
- +// Public method invoked by the animator.
- void VsyncWaiter::AsyncWaitForVsync(Callback callback) {
- + if (!callback) {
- + return;
- + }
- +
- + TRACE_EVENT0("flutter", "AsyncWaitForVsync");
- +
- {
- std::lock_guard<std::mutex> lock(callback_mutex_);
- + if (callback_) {
- + // The animator may request a frame more than once within a frame
- + // interval. Multiple calls to request frame must result in a single
- + // callback per frame interval.
- + TRACE_EVENT_INSTANT0("flutter", "MultipleCallsToVsyncInFrameInterval");
- + return;
- + }
- callback_ = std::move(callback);
- }
- AwaitVSync();
- @@ -46,6 +60,10 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
- }
- if (!callback) {
- + // This means that the vsync waiter implementation fired a callback for a
- + // request we did not make. This is a paranoid check but we still want to
- + // make sure we catch misbehaving vsync implementations.
- + TRACE_EVENT_INSTANT0("flutter", "MismatchedFrameCallback");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement