浏览代码

fix gif play speed too slow.

/wangshuang
wangshuang 3 年前
当前提交
dd1a9cc9
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      com.unity.uiwidgets/Runtime/painting/image_stream.cs

6
com.unity.uiwidgets/Runtime/painting/image_stream.cs


TimeSpan delay = _frameDuration.Value - (timestamp - _shownTimestamp.Value);
delay = new TimeSpan((long) (delay.Ticks * scheduler_.timeDilation));
// TODO: time dilation
_timer = Timer.create(delay, () => _scheduleAppFrame());
// _timer = Timer.create(delay, () => _scheduleAppFrame());
_scheduleAppFrame();
}
bool _isFirstFrame() {

bool _hasFrameDurationPassed(TimeSpan timestamp) {
D.assert(_shownTimestamp != null);
return timestamp - _shownTimestamp >= _frameDuration;
return (_frameDuration - timestamp + _shownTimestamp) <= TimeSpan.FromMilliseconds(8);
// return timestamp - _shownTimestamp >= _frameDuration;
}
Future _decodeNextFrameAndSchedule() {

正在加载...
取消
保存