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

Side by Side Diff: experimental/SkV8Example/sample.js

Issue 118473006: Allow multiple concurrent timers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up 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 unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * @fileoverview Sample onDraw script for use with SkV8Example. 2 * @fileoverview Sample onDraw script for use with SkV8Example.
3 */ 3 */
4 var onDraw = function(){ 4 var onDraw = function(){
5 var tick = 0; 5 var tick = 0;
6 function f(canvas) { 6 function f(canvas) {
7 tick += 0.1; 7 tick += 0.1;
8 canvas.fillStyle = '#0000ff'; 8 canvas.fillStyle = '#0000ff';
9 canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100); 9 canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
10 }; 10 };
11 return f; 11 return f;
12 }(); 12 }();
13 13
14 function onTimeout() { 14 function onTimeout() {
15 inval(); 15 inval();
16 print("Got a timeout!"); 16 print(setTimeout(onTimeout, 33));
17 setTimeout(onTimeout, 33);
18 } 17 }
19 18
20 setTimeout(onTimeout, 33); 19 setTimeout(onTimeout, 33);
OLDNEW
« experimental/SkV8Example/Global.h ('K') | « experimental/SkV8Example/SkV8Example.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698