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

Side by Side Diff: samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/swarm/DataSource.dart ('k') | samples/swarm/swarm_ui_lib/touch/TimeUtil.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of base; 5 part of base;
6 6
7 typedef void AnimationCallback(num currentTime); 7 typedef void AnimationCallback(num currentTime);
8 8
9 class CallbackData { 9 class CallbackData {
10 final AnimationCallback callback; 10 final AnimationCallback callback;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 assert(_intervalId != null); 118 assert(_intervalId != null);
119 if (USE_INTERVALS) { 119 if (USE_INTERVALS) {
120 window.clearInterval(_intervalId); 120 window.clearInterval(_intervalId);
121 } 121 }
122 _intervalId = null; 122 _intervalId = null;
123 } else if (USE_INTERVALS == false) { 123 } else if (USE_INTERVALS == false) {
124 _intervalId = null; 124 _intervalId = null;
125 _setupInterval(); 125 _setupInterval();
126 } 126 }
127 int numRemaining = 0; 127 int numRemaining = 0;
128 int minTime = new Date.now().millisecondsSinceEpoch + MS_PER_FRAME; 128 int minTime = new DateTime.now().millisecondsSinceEpoch + MS_PER_FRAME;
129 129
130 int len = _callbacks.length; 130 int len = _callbacks.length;
131 for (final callback in _callbacks) { 131 for (final callback in _callbacks) {
132 if (!callback.ready(minTime)) { 132 if (!callback.ready(minTime)) {
133 numRemaining++; 133 numRemaining++;
134 } 134 }
135 } 135 }
136 136
137 if (numRemaining == len) { 137 if (numRemaining == len) {
138 // TODO(jacobr): we could be more clever about this case if delayed 138 // TODO(jacobr): we could be more clever about this case if delayed
(...skipping 20 matching lines...) Expand all
159 _frameCount++; 159 _frameCount++;
160 if (_isMobileSafari) { 160 if (_isMobileSafari) {
161 // Hack to work around an iOS bug where sometimes animations do not 161 // Hack to work around an iOS bug where sometimes animations do not
162 // render if only webkit transforms were modified. 162 // render if only webkit transforms were modified.
163 // TODO(jacobr): find a cleaner workaround. 163 // TODO(jacobr): find a cleaner workaround.
164 int offset = _frameCount % 2; 164 int offset = _frameCount % 2;
165 _safariHackStyle.left = '${offset}px'; 165 _safariHackStyle.left = '${offset}px';
166 } 166 }
167 } 167 }
168 } 168 }
OLDNEW
« no previous file with comments | « samples/swarm/DataSource.dart ('k') | samples/swarm/swarm_ui_lib/touch/TimeUtil.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698