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

Unified Diff: samples/openglui/src/openglui_canvas_tests.dart

Issue 12506004: Added window.requestAnimationFrame. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « samples/openglui/android/android.gyp ('k') | samples/openglui/src/openglui_raytrace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/openglui/src/openglui_canvas_tests.dart
===================================================================
--- samples/openglui/src/openglui_canvas_tests.dart (revision 19664)
+++ samples/openglui/src/openglui_canvas_tests.dart (working copy)
@@ -43,6 +43,7 @@
throw "Failed to get 2D context";
}
resize(w, h);
+ window.requestAnimationFrame(update);
log("Done setup");
}
@@ -499,6 +500,7 @@
void loadImage() {
initTest("Image loading");
var imageObj = new ImageElement();
+ // TODO(Gram): Change gl.dart to handle to onLoad.listen.
imageObj.on.load.add((e) {
ctx.drawImage(e, 69, 50);
});
@@ -655,7 +657,8 @@
int testnum = 0; // Set this to -1 to start with last test.
-void update() {
+void update(num when) {
+ window.requestAnimationFrame(update);
if (testnum == 0) {
anim();
return;
@@ -1003,6 +1006,3 @@
}
}
-
-
-
« no previous file with comments | « samples/openglui/android/android.gyp ('k') | samples/openglui/src/openglui_raytrace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698