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

Unified Diff: experimental/SkV8Example/sample.js

Issue 103143009: Add a setTimer() function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years 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 | « experimental/SkV8Example/SkV8Example.cpp ('k') | gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/SkV8Example/sample.js
diff --git a/experimental/SkV8Example/sample.js b/experimental/SkV8Example/sample.js
index 3a95e551069c49bb230179098daf7a91af909c3d..b5160620448e2c5a7bff896ef1fb58a9be66bc16 100644
--- a/experimental/SkV8Example/sample.js
+++ b/experimental/SkV8Example/sample.js
@@ -4,10 +4,17 @@
var onDraw = function(){
var tick = 0;
function f(canvas) {
- tick += 0.01;
+ tick += 0.1;
canvas.fillStyle = '#0000ff';
canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
- canvas.inval();
};
return f;
}();
+
+function onTimeout() {
+ inval();
+ print("Got a timeout!");
+ setTimeout(onTimeout, 33);
+}
+
+setTimeout(onTimeout, 33);
« no previous file with comments | « experimental/SkV8Example/SkV8Example.cpp ('k') | gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698