blob: b5160620448e2c5a7bff896ef1fb58a9be66bc16 [file] [log] [blame]
commit-bot@chromium.org48d94b8c2013-12-16 18:24:51 +00001/**
2 * @fileoverview Sample onDraw script for use with SkV8Example.
3 */
4var onDraw = function(){
5 var tick = 0;
6 function f(canvas) {
commit-bot@chromium.org0fc0dea2013-12-18 04:45:37 +00007 tick += 0.1;
commit-bot@chromium.org48d94b8c2013-12-16 18:24:51 +00008 canvas.fillStyle = '#0000ff';
9 canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
commit-bot@chromium.org48d94b8c2013-12-16 18:24:51 +000010 };
11 return f;
12}();
commit-bot@chromium.org0fc0dea2013-12-18 04:45:37 +000013
14function onTimeout() {
15 inval();
16 print("Got a timeout!");
17 setTimeout(onTimeout, 33);
18}
19
20setTimeout(onTimeout, 33);