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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/Views.dart ('k') | samples/swarm/swarm_ui_lib/layout/GridLayout.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 _safariHackStyle.position = 'absolute'; 58 _safariHackStyle.position = 'absolute';
59 } 59 }
60 } 60 }
61 61
62 /** 62 /**
63 * Cancel the pending callback matching the specified [id]. 63 * Cancel the pending callback matching the specified [id].
64 * This is not heavily optimized as typically users don't cancel animation 64 * This is not heavily optimized as typically users don't cancel animation
65 * frames. 65 * frames.
66 */ 66 */
67 void cancelRequestAnimationFrame(int id) { 67 void cancelRequestAnimationFrame(int id) {
68 _callbacks = _callbacks.filter((CallbackData e) => e.id != id); 68 _callbacks = _callbacks.where((CallbackData e) => e.id != id).toList();
69 } 69 }
70 70
71 /** 71 /**
72 * Schedule [callback] to execute at the next animation frame that occurs 72 * Schedule [callback] to execute at the next animation frame that occurs
73 * at or after [minTime]. If [minTime] is not specified, the first available 73 * at or after [minTime]. If [minTime] is not specified, the first available
74 * animation frame is used. Returns an id that can be used to cancel the 74 * animation frame is used. Returns an id that can be used to cancel the
75 * pending callback. 75 * pending callback.
76 */ 76 */
77 int requestAnimationFrame(AnimationCallback callback, 77 int requestAnimationFrame(AnimationCallback callback,
78 [Element element = null, 78 [Element element = null,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/Views.dart ('k') | samples/swarm/swarm_ui_lib/layout/GridLayout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698