Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: sky/framework/animation/simulation.dart

Issue 1001373002: Organize sky/framework/animation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/animation/scroll_curve.dart ('k') | sky/framework/animation/timer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/animation/simulation.dart
diff --git a/sky/framework/animation/simulation.dart b/sky/framework/animation/simulation.dart
deleted file mode 100644
index a1d79c394d0d614235efee95bd0f58680c1cb736..0000000000000000000000000000000000000000
--- a/sky/framework/animation/simulation.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'dart:async';
-import 'generator.dart';
-import 'mechanics.dart';
-
-class Simulation {
- Stream<double> get onTick => _stream;
- final System system;
-
- FrameGenerator _generator;
- Stream<double> _stream;
- double _previousTime = 0.0;
-
- Simulation(this.system, {Function terminationCondition, Function onDone}) {
- _generator = new FrameGenerator(onDone: onDone);
- _stream = _generator.onTick.map(_update);
-
- if (terminationCondition != null) {
- bool done = false;
- _stream = _stream.takeWhile((_) {
- if (done)
- return false;
- done = terminationCondition();
- return true;
- });
- }
- }
-
- void cancel() {
- _generator.cancel();
- }
-
- double _update(double timeStamp) {
- double previousTime = _previousTime;
- _previousTime = timeStamp;
- if (previousTime == 0.0)
- return timeStamp;
- double deltaT = timeStamp - previousTime;
- system.update(deltaT);
- return timeStamp;
- }
-}
« no previous file with comments | « sky/framework/animation/scroll_curve.dart ('k') | sky/framework/animation/timer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698