Fix truncation of frame time on 32-bit Android. (flutter/engine#4040)
This commit is contained in:
@@ -62,9 +62,7 @@ void Animator::BeginFrame(ftl::TimePoint frame_time) {
|
||||
// to service potential frame.
|
||||
FTL_DCHECK(producer_continuation_);
|
||||
|
||||
// TODO(abarth): We should use |frame_time| instead, but the frame time we get
|
||||
// on Android appears to be unstable.
|
||||
last_begin_frame_time_ = ftl::TimePoint::Now();
|
||||
last_begin_frame_time_ = frame_time;
|
||||
engine_->BeginFrame(last_begin_frame_time_);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) {
|
||||
});
|
||||
}
|
||||
|
||||
void VsyncWaiterAndroid::OnVsync(long frameTimeNanos) {
|
||||
void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos) {
|
||||
Callback callback = std::move(callback_);
|
||||
callback_ = Callback();
|
||||
blink::Threads::UI()->PostTask([callback, frameTimeNanos] {
|
||||
@@ -61,7 +61,7 @@ static void OnNativeVsync(JNIEnv* env,
|
||||
VsyncWaiterAndroid* waiter = weak->get();
|
||||
delete weak;
|
||||
if (waiter) {
|
||||
waiter->OnVsync(frameTimeNanos);
|
||||
waiter->OnVsync(static_cast<int64_t>(frameTimeNanos));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class VsyncWaiterAndroid : public VsyncWaiter {
|
||||
|
||||
void AsyncWaitForVsync(Callback callback) override;
|
||||
|
||||
void OnVsync(long frameTimeNanos);
|
||||
void OnVsync(int64_t frameTimeNanos);
|
||||
|
||||
private:
|
||||
Callback callback_;
|
||||
|
||||
Reference in New Issue
Block a user