Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8c2e7a7

Browse files
committed
use fml::TimePoint
1 parent 844e833 commit 8c2e7a7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

shell/common/animator.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ const char* Animator::FrameParity() {
8686
return (frame_number % 2) ? "even" : "odd";
8787
}
8888

89-
static int64_t FxlToDartOrEarlier(fml::TimePoint time) {
90-
int64_t dart_now = Dart_TimelineGetMicros();
89+
static fml::TimePoint FxlToDartOrEarlier(fml::TimePoint time) {
90+
auto dart_now = fml::TimeDelta::FromMicroseconds(Dart_TimelineGetMicros());
9191
fml::TimePoint fxl_now = fml::TimePoint::Now();
92-
return (time - fxl_now).ToMicroseconds() + dart_now;
92+
return fml::TimePoint::FromEpochDelta(time - fxl_now + dart_now);
9393
}
9494

9595
void Animator::BeginFrame(
@@ -269,7 +269,8 @@ void Animator::AwaitVSync() {
269269
}
270270
});
271271

272-
delegate_.OnAnimatorNotifyIdle(dart_frame_deadline_);
272+
delegate_.OnAnimatorNotifyIdle(
273+
dart_frame_deadline_.ToEpochDelta().ToMicroseconds());
273274
}
274275

275276
void Animator::ScheduleSecondaryVsyncCallback(uintptr_t id,

shell/common/animator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Animator final {
106106

107107
std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder_;
108108
uint64_t frame_request_number_ = 1;
109-
int64_t dart_frame_deadline_ = 0;
109+
fml::TimePoint dart_frame_deadline_;
110110
std::shared_ptr<LayerTreePipeline> layer_tree_pipeline_;
111111
fml::Semaphore pending_frame_semaphore_;
112112
LayerTreePipeline::ProducerContinuation producer_continuation_;

0 commit comments

Comments
 (0)