From 366dcb1588def6699558e654310b562808086ac8 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 6 Jun 2019 09:50:45 -0700 Subject: [PATCH] Revert engine back to afb9d510c3bb0f1b97980434b41200a2d3491697 (#33982) Revert "Add currentSystemFrameTimeStamp to SchedulerBinding (#33886)" This reverts commit 61b83d320e9149828ffb5e39e1da6d14d281c0c2. --- bin/internal/engine.version | 2 +- .../flutter/lib/src/scheduler/binding.dart | 16 --------- .../test/scheduler/scheduler_test.dart | 33 ------------------- 3 files changed, 1 insertion(+), 50 deletions(-) diff --git a/bin/internal/engine.version b/bin/internal/engine.version index 5e8b4d365c2..2d528c0754e 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -3371da1e09511cb047c746e8209ec91550714b05 +afb9d510c3bb0f1b97980434b41200a2d3491697 diff --git a/packages/flutter/lib/src/scheduler/binding.dart b/packages/flutter/lib/src/scheduler/binding.dart index e1c04f049b1..273320a85b5 100644 --- a/packages/flutter/lib/src/scheduler/binding.dart +++ b/packages/flutter/lib/src/scheduler/binding.dart @@ -846,22 +846,6 @@ mixin SchedulerBinding on BindingBase, ServicesBinding { } Duration _currentFrameTimeStamp; - /// The raw time stamp as provided by the engine to [Window.onBeginFrame] - /// for the frame currently being processed. - /// - /// Unlike [currentFrameTimeStamp], this time stamp is neither adjusted to - /// offset when the epoch started nor scaled to reflect the [timeDilation] in - /// the current epoch. - /// - /// On most platforms, this is a more or less arbitrary value, and should - /// generally be ignored. On Fuchsia, this corresponds to the system-provided - /// presentation time, and can be used to ensure that animations running in - /// different processes are synchronized. - Duration get currentSystemFrameTimeStamp { - assert(_lastRawTimeStamp != null); - return _lastRawTimeStamp; - } - int _profileFrameNumber = 0; final Stopwatch _profileFrameStopwatch = Stopwatch(); String _debugBanner; diff --git a/packages/flutter/test/scheduler/scheduler_test.dart b/packages/flutter/test/scheduler/scheduler_test.dart index 3e62c046598..fe14690879a 100644 --- a/packages/flutter/test/scheduler/scheduler_test.dart +++ b/packages/flutter/test/scheduler/scheduler_test.dart @@ -8,7 +8,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import '../flutter_test_alternative.dart'; -import 'scheduler_tester.dart'; class TestSchedulerBinding extends BindingBase with ServicesBinding, SchedulerBinding { } @@ -136,36 +135,4 @@ void main() { expect(scheduler.schedulerPhase, SchedulerPhase.idle); expect(taskExecuted, false); }); - - test('currentSystemFrameTimeStamp is the raw timestamp', () { - Duration lastTimeStamp; - Duration lastSystemTimeStamp; - - void frameCallback(Duration timeStamp) { - expect(timeStamp, scheduler.currentFrameTimeStamp); - lastTimeStamp = scheduler.currentFrameTimeStamp; - lastSystemTimeStamp = scheduler.currentSystemFrameTimeStamp; - } - - scheduler.scheduleFrameCallback(frameCallback); - tick(const Duration(seconds: 2)); - expect(lastTimeStamp, Duration.zero); - expect(lastSystemTimeStamp, const Duration(seconds: 2)); - - scheduler.scheduleFrameCallback(frameCallback); - tick(const Duration(seconds: 4)); - expect(lastTimeStamp, const Duration(seconds: 2)); - expect(lastSystemTimeStamp, const Duration(seconds: 4)); - - timeDilation = 2; - scheduler.scheduleFrameCallback(frameCallback); - tick(const Duration(seconds: 6)); - expect(lastTimeStamp, const Duration(seconds: 2)); // timeDilation calls SchedulerBinding.resetEpoch - expect(lastSystemTimeStamp, const Duration(seconds: 6)); - - scheduler.scheduleFrameCallback(frameCallback); - tick(const Duration(seconds: 8)); - expect(lastTimeStamp, const Duration(seconds: 3)); // 2s + (8 - 6)s / 2 - expect(lastSystemTimeStamp, const Duration(seconds: 8)); - }); }